Extension extends Extension
AbstractYes
Table of Contents
Methods
- __construct() : mixed
- The constructor of extensions should not be used.
- getMetadataKeys() : string[]
- The keys of the metadata objects this extension can render.
- getTemplatePath() : string|null
- Directory with the Twig templates of this extension.
Methods
__construct()
The constructor of extensions should not be used.
public
final __construct() : mixed
Extensions are loaded by the ExtensionHandler. An extension should not apply any logic in its constructor; use load() to register services and parameters instead.
getMetadataKeys()
The keys of the metadata objects this extension can render.
public
getMetadataKeys() : string[]
The template that renders a key is expected at <template path>/metadata/<key>.html.twig.
Return values
string[]getTemplatePath()
Directory with the Twig templates of this extension.
public
getTemplatePath() : string|null
The directory is registered in the Twig namespace named after the alias of the extension, for example
@my-extension/metadata/my_key.html.twig.