class PropelTemplate
Simple templating system to ease behavior writing
Methods
setTemplate(string $template)
Set a string as a template. |
||
setTemplateFile(string $filePath)
Set a file as a template. |
||
string |
render(array $vars = array())
Render the template using the variable provided as arguments. |
Details
at line 32
public
setTemplate(string $template)
Set a string as a template.
The string doesn't need closing php tags.
$template->setTemplate('This is ');
at line 46
public
setTemplateFile(string $filePath)
Set a file as a template.
The file can be any regular PHP file.
$template->setTemplateFile(dirname(FILE) . '/template/foo.php');
at line 68
public string
render(array $vars = array())
Render the template using the variable provided as arguments.
$template = new PropelTemplate();
$template->setTemplate('This is ');
echo $template->render(array('name' => 'Mike'));
// This is Mike