Symfony2 API
Class

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.

Boolean isOptional()

Checks whether this warmer is optional or not.

Details

at line 37
public __construct(ContainerInterface $container, TemplateFinderInterface $finder)

Constructor.

Parameters

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

at line 52
public warmUp(string $cacheDir)

Warms up the cache.

Parameters

string $cacheDir The cache directory

at line 74
public Boolean isOptional()

Checks whether this warmer is optional or not.

Optional warmers can be ignored on certain conditions.

A warmer should return true if the cache can be
generated incrementally and on-demand.

Return Value

Boolean always true