TemplateCacheWarmer
in package
implements
CacheWarmerInterface, ServiceSubscriberInterface
Generates the Twig cache for all templates.
Tags
Table of Contents
Interfaces
- CacheWarmerInterface
- Interface for classes able to warm up the cache.
- ServiceSubscriberInterface
- A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method.
Properties
- $container : mixed
- $iterator : iterable<string|int, mixed>
- $twig : mixed
Methods
- __construct() : mixed
- getSubscribedServices() : array<string|int, string>
- Returns an array of service types required by such instances, optionally keyed by the service names used internally.
- isOptional() : bool
- Checks whether this warmer is optional or not.
- warmUp() : array<string|int, string>
- {@inheritdoc}
Properties
$container
private
mixed
$container
$iterator
private
iterable<string|int, mixed>
$iterator
$twig
private
mixed
$twig
Methods
__construct()
public
__construct(ContainerInterface $container, iterable<string|int, mixed> $iterator) : mixed
Parameters
- $container : ContainerInterface
- $iterator : iterable<string|int, mixed>
getSubscribedServices()
Returns an array of service types required by such instances, optionally keyed by the service names used internally.
public
static getSubscribedServices() : array<string|int, string>
Return values
array<string|int, string> —The required service types, optionally keyed by service names
isOptional()
Checks whether this warmer is optional or not.
public
isOptional() : bool
Return values
boolwarmUp()
{@inheritdoc}
public
warmUp(string $cacheDir) : array<string|int, string>
Parameters
- $cacheDir : string
Return values
array<string|int, string> —A list of template files to preload on PHP 7.4+