Yaf_View_Simple
class Yaf_View_Simple implements Yaf_View_Interface (View source)
Yaf_View_Simple is the built-in template engine in Yaf, it is a simple but fast template engine, and only support PHP script template.
Properties
protected string | $_tpl_dir | ||
protected array | $_tpl_vars | ||
protected array | $_options |
Methods
No description
No description
assign variable to view engine
No description
Render a template and display the result instantly.
unlike Yaf_View_Simple::assign(), this method assign a ref value to engine.
clear assigned variable
Set the templates base directory, this is usually called by Yaf_Dispatcher
No description
Retrieve assigned variable
Note:
$name parameter can be empty since 2.1.11
This is a alternative and easier way to Yaf_View_Simple::assign().
Render a string template and return the result.
No description
Details
final
__construct(string $template_dir, array|null $options = null)
No description
__isset(string $name)
No description
Yaf_View_Interface|bool
assign(string|array $name, mixed $value = null)
assign variable to view engine
string|bool
render(string $tpl, array $tpl_vars = null)
No description
bool
display(string $tpl, array $tpl_vars = null)
Render a template and display the result instantly.
Yaf_View_Simple
assignRef(string $name, mixed $value)
unlike Yaf_View_Simple::assign(), this method assign a ref value to engine.
Yaf_View_Simple
clear(string $name = null)
clear assigned variable
bool
setScriptPath(string $template_dir)
Set the templates base directory, this is usually called by Yaf_Dispatcher
string
getScriptPath()
No description
mixed
__get(string $name = null)
Retrieve assigned variable
Note:
$name parameter can be empty since 2.1.11
__set(string $name, mixed $value = null)
This is a alternative and easier way to Yaf_View_Simple::assign().
void|false
eval(string $tpl_str, array $vars = null)
Render a string template and return the result.
mixed
get(string $name = '')
No description