interface Yaf_View_Interface (View source)

Yaf provides a ability for developers to use custom view engine instead of build-in engine which is Yaf_View_Simple. There is a example to explain how to do this, please see Yaf_Dispatcher::setView()

Methods

assign(string|array $name, mixed $value = '')

Assign values to View engine, then the value can access directly by name in template.

bool
display(string $tpl, array $tpl_vars = null)

Render a template and output the result immediately.

string
getScriptPath()

No description

string|bool
render(string $tpl, array $tpl_vars = null)

Render a template and return the result.

bool
setScriptPath(string $template_dir)

Set the templates base directory, this is usually called by Yaf_Dispatcher

Details

Yaf_View_Interface|bool assign(string|array $name, mixed $value = '')

Assign values to View engine, then the value can access directly by name in template.

Parameters

string|array $name
mixed $value

Return Value

Yaf_View_Interface|bool

bool display(string $tpl, array $tpl_vars = null)

Render a template and output the result immediately.

Parameters

string $tpl
array $tpl_vars

Return Value

bool

string getScriptPath()

No description

Return Value

string

string|bool render(string $tpl, array $tpl_vars = null)

Render a template and return the result.

Parameters

string $tpl
array $tpl_vars

Return Value

string|bool

bool setScriptPath(string $template_dir)

Set the templates base directory, this is usually called by Yaf_Dispatcher

Parameters

string $template_dir

An absolute path to the template directory, by default, Yaf_Dispatcher use application.directory . "/views" as this parameter.

Return Value

bool