Documentation

TwigExtension extends Extension
in package

TwigExtension.

Tags
author

Fabien Potencier fabien@symfony.com

author

Jeremy Mikola jmikola@gmail.com

Table of Contents

Properties

$annotatedClasses  : array<string|int, mixed>
$processedConfigs  : array<string|int, mixed>

Methods

addAnnotatedClassesToCompile()  : mixed
Adds annotated classes to the class cache.
getAlias()  : string
Returns the recommended alias to use in XML.
getAnnotatedClassesToCompile()  : array<string|int, mixed>
Gets the annotated classes to cache.
getConfiguration()  : ConfigurationInterface|null
Returns extension configuration.
getNamespace()  : string
getXsdValidationBasePath()  : string|false
{@inheritdoc}
load()  : mixed
isConfigEnabled()  : bool
processConfiguration()  : array<string|int, mixed>
getBundleTemplatePaths()  : array<string|int, mixed>
normalizeBundleName()  : string

Properties

$annotatedClasses

private array<string|int, mixed> $annotatedClasses = []

$processedConfigs

private array<string|int, mixed> $processedConfigs = []

Methods

addAnnotatedClassesToCompile()

Adds annotated classes to the class cache.

public addAnnotatedClassesToCompile(array<string|int, mixed> $annotatedClasses) : mixed
Parameters
$annotatedClasses : array<string|int, mixed>

An array of class patterns

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
throws
BadMethodCallException

When the extension name does not follow conventions

Return values
string

getAnnotatedClassesToCompile()

Gets the annotated classes to cache.

public getAnnotatedClassesToCompile() : array<string|int, mixed>
Return values
array<string|int, mixed>

getNamespace()

public getNamespace() : string
Return values
string

getXsdValidationBasePath()

{@inheritdoc}

public getXsdValidationBasePath() : string|false
Return values
string|false

processConfiguration()

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>

getBundleTemplatePaths()

private getBundleTemplatePaths(ContainerBuilder $container, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
$container : ContainerBuilder
$config : array<string|int, mixed>
Return values
array<string|int, mixed>

normalizeBundleName()

private normalizeBundleName(string $name) : string
Parameters
$name : string
Return values
string

        
On this page

Search results