class Template

Properties

private $env
private array $lastCompiled

A stack of the last compiled templates.

protected $path
protected $page
protected $layout
protected $theme
protected $param
protected $controller
protected $session

Methods

__construct(Environment $env, $path)

This method is for internal use only and should never be called directly (use Environment::load() instead).

string
render(array $data = [])

Renders the template.

mergeGlobals($data)

No description

getContents($data)

No description

array
gatherData($data)

Get the data bound to the view instance.

evaluatePath($path, $data)

No description

handleException($ex, $level)

No description

string
getMessage(Exception $e)

Get the exception message for an exception.

getSourceFilePath()

No description

Details

at line 43
__construct(Environment $env, $path)

internal  
 

This method is for internal use only and should never be called directly (use Environment::load() instead).

Parameters

Environment $env
$path

at line 58
string render(array $data = [])

Renders the template.

Parameters

array $data

An array of parameters to pass to the template

Return Value

string

The rendered template

Exceptions

Exception
Throwable

at line 73
protected mergeGlobals($data)

No description

Parameters

$data

at line 83
protected getContents($data)

No description

Parameters

$data

at line 94
protected array gatherData($data)

Get the data bound to the view instance.

Parameters

$data

Return Value

array

at line 106
protected evaluatePath($path, $data)

No description

Parameters

$path
$data

at line 134
protected handleException($ex, $level)

No description

Parameters

$ex
$level

at line 151
protected string getMessage(Exception $e)

Get the exception message for an exception.

Parameters

Exception $e

Return Value

string

at line 156
protected getSourceFilePath()

No description