interface Twig_LoaderInterface

Interface all loaders must implement.

Methods

getSourceContext(string $name)

Returns the source context for a given template logical name.

string
getCacheKey(string $name)

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

bool
isFresh(string $name, int $time)

Returns true if the template is still fresh.

bool
exists(string $name)

Check if we have the source code of a template, given its name.

Details

at line 28
Twig_Source getSourceContext(string $name)

Returns the source context for a given template logical name.

Parameters

string $name The template logical name

Return Value

Twig_Source

Exceptions

Twig_Error_Loader When $name is not found

at line 39
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 52
bool isFresh(string $name, int $time)

Returns true if the template is still fresh.

Parameters

string $name The template name
int $time Timestamp of the last modification time of the cached template

Return Value

bool true if the template is fresh, false otherwise

Exceptions

Twig_Error_Loader When $name is not found

at line 61
bool exists(string $name)

Check if we have the source code of a template, given its name.

Parameters

string $name The name of the template to check if we can load

Return Value

bool If the template source code is handled by this loader or not