GuidesExtension
extends Extension
in package
implements
CompilerPassInterface, ConfigurationInterface, PrependExtensionInterface
FinalYes
Provides useful features shared by many extensions.
Table of Contents
Interfaces
- CompilerPassInterface
- Interface that must be implemented by compilation passes.
- ConfigurationInterface
- Configuration interface.
- PrependExtensionInterface
Methods
- getAlias() : string
- Returns the recommended alias to use in XML.
- getConfigTreeBuilder() : TreeBuilder
- Generates the configuration tree builder.
- getConfiguration() : ConfigurationInterface|null
- Returns extension configuration.
- getNamespace() : string
- Returns the namespace to be used for this extension (XML namespace).
- getXsdValidationBasePath() : string|false
- Returns the base path for the XSD files.
- load() : void
- Loads a specific configuration.
- prepend() : void
- Allow an extension to prepend the extension configurations.
- process() : void
- You can modify the container here before it is dumped to PHP code.
- isConfigEnabled() : bool
- processConfiguration() : array<string|int, mixed>
- configureSanitizers() : void
- paths() : ArrayNodeDefinition
Methods
getAlias()
Returns the recommended alias to use in XML.
public
getAlias() : string
This alias is also the mandatory prefix to use when using YAML.
This convention is to remove the "Extension" postfix from the class name and then lowercase and underscore the result. So:
AcmeHelloExtension
becomes
acme_hello
This can be overridden in a sub-class to specify the alias manually.
Tags
Return values
stringgetConfigTreeBuilder()
Generates the configuration tree builder.
public
getConfigTreeBuilder() : TreeBuilder
Return values
TreeBuildergetConfiguration()
Returns extension configuration.
public
getConfiguration(array<string|int, mixed> $config, ContainerBuilder $container) : ConfigurationInterface|null
Parameters
- $config : array<string|int, mixed>
- $container : ContainerBuilder
Return values
ConfigurationInterface|nullgetNamespace()
Returns the namespace to be used for this extension (XML namespace).
public
getNamespace() : string
Return values
stringgetXsdValidationBasePath()
Returns the base path for the XSD files.
public
getXsdValidationBasePath() : string|false
Return values
string|falseload()
Loads a specific configuration.
public
load(array<string|int, mixed> $configs, ContainerBuilder $container) : void
Parameters
- $configs : array<string|int, mixed>
- $container : ContainerBuilder
prepend()
Allow an extension to prepend the extension configurations.
public
prepend(ContainerBuilder $container) : void
Parameters
- $container : ContainerBuilder
process()
You can modify the container here before it is dumped to PHP code.
public
process(ContainerBuilder $container) : void
Parameters
- $container : ContainerBuilder
isConfigEnabled()
protected
isConfigEnabled(ContainerBuilder $container, array<string|int, mixed> $config) : bool
Parameters
- $container : ContainerBuilder
- $config : array<string|int, mixed>
Tags
Return values
boolprocessConfiguration()
protected
final processConfiguration(ConfigurationInterface $configuration, array<string|int, mixed> $configs) : array<string|int, mixed>
Parameters
- $configuration : ConfigurationInterface
- $configs : array<string|int, mixed>
Return values
array<string|int, mixed>configureSanitizers()
private
configureSanitizers(array<string, mixed> $rawNodeConfig, ContainerBuilder $container) : void
Parameters
- $rawNodeConfig : array<string, mixed>
- $container : ContainerBuilder
paths()
private
paths([array<string|int, string> $defaultValue = [] ]) : ArrayNodeDefinition
Parameters
- $defaultValue : array<string|int, string> = []