TemplateCacheCacheWarmer
in package
implements
CacheWarmerInterface, CompatibilityServiceSubscriberInterface
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.
Tags
Interfaces, Classes, Traits and Enums
- CacheWarmerInterface
- Interface for classes able to warm up the cache.
- CompatibilityServiceSubscriberInterface
Table of Contents
- $container : mixed
- $finder : mixed
- $paths : mixed
- __construct() : mixed
- getSubscribedServices() : mixed
- {@inheritdoc}
- isOptional() : bool
- Checks whether this warmer is optional or not.
- warmUp() : mixed
- Warms up the cache.
- findTemplatesInFolder() : array<string|int, mixed>
- Find templates in the given directory.
Properties
$container
protected
mixed
$container
$finder
protected
mixed
$finder
$paths
private
mixed
$paths
Methods
__construct()
public
__construct(ContainerInterface $container[, TemplateFinderInterface $finder = null ][, array<string|int, mixed> $paths = [] ]) : mixed
Parameters
- $container : ContainerInterface
- $finder : TemplateFinderInterface = null
- $paths : array<string|int, mixed> = []
-
Additional twig paths to warm
Return values
mixed —getSubscribedServices()
{@inheritdoc}
public
static getSubscribedServices() : mixed
Return values
mixed —isOptional()
Checks whether this warmer is optional or not.
public
isOptional() : bool
Return values
bool —always true
warmUp()
Warms up the cache.
public
warmUp(string $cacheDir) : mixed
Parameters
- $cacheDir : string
-
The cache directory
Return values
mixed —findTemplatesInFolder()
Find templates in the given directory.
private
findTemplatesInFolder(string|null $namespace, string $dir) : array<string|int, mixed>
Parameters
- $namespace : string|null
- $dir : string