Simple
class Simple implements 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.
No description
No description
This is a alternative and easier way to \Yaf\View\Simple::assign().
Render a string template and return the result.
Details
final
__construct(string $template_dir, array $options = null)
No description
__isset(string $name)
No description
bool
assign(string|array $name, mixed $value = null)
assign variable to view engine
string
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.
Simple
assignRef(string $name, mixed $value)
unlike \Yaf\View\Simple::assign(), this method assign a ref value to engine.
Simple
clear(string $name = null)
clear assigned variable
setScriptPath(string $template_dir)
No description
string
getScriptPath()
No description
mixed
__get(null $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|bool
eval(string $tpl_str, array $vars = null)
Render a string template and return the result.