class StringTemplateLoader implements Twig_LoaderInterface, Twig_ExistsLoaderInterface

Methods

string
getSource(string $name)

Returns the source code for a given template name.

Twig_Source
getSourceContext(string $name)

Returns the source context for a given template logical name.

string
getCacheKey(string $name)

Returns 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. For this loader, the template is always fresh.

bool
exists(string $name)

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

Details

at line 22
string getSource(string $name)

Returns the source code for a given template name.

For this loader, the name of the template is the source code.

Parameters

string $name The name of the template

Return Value

string The source code of the template

at line 33
Twig_Source getSourceContext(string $name)

Returns the source context for a given template logical name.

Parameters

string $name The name of the template

Return Value

Twig_Source The source context

at line 46
string getCacheKey(string $name)

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

For this loader, the name (source code) of the template is the cache key.

Parameters

string $name The name of the template

Return Value

string The cache key

at line 59
bool isFresh(string $name, int $time)

Returns true if the template is still fresh. For this loader, the template is always fresh.

Parameters

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

Return Value

bool always true

at line 71
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

Return Value

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