Application::fetchTemplate
Return compiled template into a string
Description
public string Application::fetchTemplate( string $template, [ array $assignedValue = array() ] )
Returns the Application::displayTemplate into string without displaying the output.
Arguments
Name | Data type | Default | Remarks |
---|---|---|---|
$template | string | Template file name | |
$assignedValue | array | array() | Arguments for template |
Example
$content = $this->fetchTemplate( 'foo/bar' );
This assigned the Application::displayTemplate to $content variable from compiled template.
note
You should not include the “.tpl” extension in the parameter.