ChainLoader

Implements\Twig\Loader\LoaderInterface, \Twig\Loader\ExistsLoaderInterface, \Twig\Loader\SourceContextLoaderInterface

Loads templates from other loaders.

final
author

Fabien Potencier fabien@symfony.com

package

Default

Methods

__construct

__construct(array<mixed,\Twig\Loader\LoaderInterface> $loaders = array())

Arguments

$loaders

array<mixed,\Twig\Loader\LoaderInterface>

addLoader

addLoader(\Twig\Loader\LoaderInterface $loader)

Arguments

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

exists(string $name): boolean

Arguments

$name

string

The name of the template to check if we can load

Response

boolean

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

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

getCacheKey(string $name): string

Arguments

$name

string

The name of the template to load

Response

string

The cache key

getLoaders

getLoaders(): array<mixed,\Twig\Loader\LoaderInterface>

Response

array<mixed,\Twig\Loader\LoaderInterface>

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

getSource(string $name): string

Arguments

$name

string

The name of the template to load

Response

string

The template source code

Returns the source context for a given template logical name.

getSourceContext(string $name): \Twig\Source

Arguments

$name

string

The template logical name

Response

\Twig\Source

Returns true if the template is still fresh.

isFresh(string $name,integer $time): boolean

Arguments

$name

string

The template name

$time

integer

Timestamp of the last modification time of the cached template

Response

boolean

true if the template is fresh, false otherwise

Properties

hasSourceCache

hasSourceCache :

Type(s)

loaders

loaders :

Type(s)