W3cubDocs

/Symfony 2.7

Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer

class TemplateCacheCacheWarmer implements CacheWarmerInterface

Generates the Twig cache for all templates.

This warmer must be registered after TemplatePathsCacheWarmer, as the Twig loader will need the cache generated by it.

Methods

__construct(ContainerInterface $container, TemplateFinderInterface $finder)

Constructor.

warmUp(string $cacheDir)

Warms up the cache.

bool isOptional()

Checks whether this warmer is optional or not.

Details

public __construct(ContainerInterface $container, TemplateFinderInterface $finder)

Constructor.

Parameters

ContainerInterface $container The dependency injection container
TemplateFinderInterface $finder The template paths cache warmer

public warmUp(string $cacheDir)

Warms up the cache.

Parameters

string $cacheDir The cache directory

public bool isOptional()

Checks whether this warmer is optional or not.

Return Value

bool always true

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.html