Loader

This class implements a Twig template loader for the core system and backend.

 class System\Twig\Loader
implements 
    Twig\Loader\LoaderInterface

Properties

public static $allowInclude : bool

Allow any local file

protected $cache : array

Cache

Methods

public exists (string $name) : bool

Checks that the template exists.

Parameters
Property Description
$name
string
Returns
bool

public getCacheKey (string $name) : string

Returns the Twig cache key.

Parameters
Property Description
$name
string
Returns
string

public getFilename (string $name) : string

Returns the file name of the loaded template.

Parameters
Property Description
$name
string
Returns
string

public getSourceContext (string $name) : Twig\Source

Returns the Twig content string.

This step is cached internally by Twig.

Parameters
Property Description
$name
string
Returns
Twig\Source

public isFresh (string $name, integer $time) : bool

Determines if the content is fresh.

Parameters
Property Description
$name
string
$time
integer
Returns
bool

protected findTemplate (string $name) : string

Gets the path of a view file.

Parameters
Property Description
$name
string
Returns
string
Copyright © 2024 Winter CMS