Skip to main content

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

NameData typeDefaultRemarks
$templatestringTemplate file name
$assignedValuearrayarray()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.