MetadataTemplateResolver
FinalYes
Finds the template with which an extension renders a metadata object.
Extensions declare the metadata keys they handle. The template of a key is found by convention in the Twig
namespace of the extension: @<alias>/metadata/<key>.html.twig.
A key can also have an entry in "On this page", which links to the rendered metadata:
@<alias>/on-this-page/<key>.html.twig. That template is optional, so a missing one is not reported.
Table of Contents
Properties
- $extensions : array
- $logger : LoggerInterface
Methods
- __construct() : mixed
- resolve() : string|null
- resolveOnThisPage() : string|null
- The template of the entry in "On this page" for a metadata object, if the extension that declares its key provides one.
Properties
$extensions read-only
private
array
$extensions
$logger read-only
private
LoggerInterface
$logger
Methods
__construct()
public
__construct(array<string, array{path: string, keys: string[]}> $extensions, LoggerInterface $logger) : mixed
Parameters
- $extensions : array<string, array{path: string, keys: string[]}>
-
indexed by the alias of the extension
- $logger : LoggerInterface
resolve()
public
resolve(Metadata $metadata, string $nodeName, LoaderInterface $loader) : string|null
Parameters
- $metadata : Metadata
- $nodeName : string
- $loader : LoaderInterface
Return values
string|nullresolveOnThisPage()
The template of the entry in "On this page" for a metadata object, if the extension that declares its key provides one.
public
resolveOnThisPage(Metadata $metadata, LoaderInterface $loader) : string|null
Parameters
- $metadata : Metadata
- $loader : LoaderInterface