Twig API
Interface

Twig_LoaderInterface

interface Twig_LoaderInterface

Interface all loaders must implement.

Methods

string getSource(string $name)

Gets the source code of a template, given its name.

string getCacheKey(string $name)

Gets the cache key to use for the cache for a given template name.

Boolean isFresh(string $name, timestamp $time)

Returns true if the template is still fresh.

Details

at line 28
public string getSource(string $name)

Gets the source code of a template, given its name.

Parameters

string $name The name of the template to load

Return Value

string The template source code

Exceptions

Twig_Error_Loader When $name is not found

at line 39
public string getCacheKey(string $name)

Gets the cache key to use for the cache for a given template name.

Parameters

string $name The name of the template to load

Return Value

string The cache key

Exceptions

Twig_Error_Loader When $name is not found

at line 51
public Boolean isFresh(string $name, timestamp $time)

Returns true if the template is still fresh.

Parameters

string $name The template name
timestamp $time The last modification time of the cached template

Return Value

Boolean true if the template is fresh, false otherwise

Exceptions

Twig_Error_Loader When $name is not found