TwigExtension::setGenerators

public TwigExtension::setGenerators(UrlGeneratorInterface $url_generator) Sets the URL generator. Parameters \Drupal\Core\Routing\UrlGeneratorInterface $url_generator: The URL generator. Return value $this Deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. Use \Drupal\Core\Template\TwigExtension::setUrlGenerator(). File core/lib/Drupal/Core/Template/TwigExtension.php, line 77 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Templ

TwigExtension::setThemeManager

public TwigExtension::setThemeManager(ThemeManagerInterface $theme_manager) Sets the theme manager. Parameters \Drupal\Core\Theme\ThemeManagerInterface $theme_manager: The theme manager. Return value $this File core/lib/Drupal/Core/Template/TwigExtension.php, line 102 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Template Code public function setThemeManager(ThemeManagerInterface $theme_manager) { $this->themeManager = $theme_manager; retu

TwigExtension::setUrlGenerator

public TwigExtension::setUrlGenerator(UrlGeneratorInterface $url_generator) Sets the URL generator. Parameters \Drupal\Core\Routing\UrlGeneratorInterface $url_generator: The URL generator. Return value $this File core/lib/Drupal/Core/Template/TwigExtension.php, line 89 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Template Code public function setUrlGenerator(UrlGeneratorInterface $url_generator) { $this->urlGenerator = $url_generator; ret

TwigExtension::__construct

public TwigExtension::__construct(RendererInterface $renderer) Constructs \Drupal\Core\Template\TwigExtension. Parameters \Drupal\Core\Render\RendererInterface $renderer: The renderer. File core/lib/Drupal/Core/Template/TwigExtension.php, line 62 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Template Code public function __construct(RendererInterface $renderer) { $this->renderer = $renderer; }

TwigExtensionPass

Adds the twig_extension_hash parameter to the container. twig_extension_hash is a hash of all extension mtimes for Twig template invalidation. Hierarchy class \Drupal\Core\DependencyInjection\Compiler\TwigExtensionPass implements CompilerPassInterface File core/lib/Drupal/Core/DependencyInjection/Compiler/TwigExtensionPass.php, line 14 Namespace Drupal\Core\DependencyInjection\Compiler Members Name Modifiers Type Description TwigExtensionPass::process public function You

TwigExtensionPass::process

public TwigExtensionPass::process(ContainerBuilder $container) You can modify the container here before it is dumped to PHP code. Parameters ContainerBuilder $container: Overrides CompilerPassInterface::process File core/lib/Drupal/Core/DependencyInjection/Compiler/TwigExtensionPass.php, line 19 Class TwigExtensionPass Adds the twig_extension_hash parameter to the container. Namespace Drupal\Core\DependencyInjection\Compiler Code public function process(ContainerBuilder $container) {

TwigNodeTrans

A class that defines the Twig 'trans' tag for Drupal. This Twig extension was originally based on Twig i18n extension. It has been severely modified to work properly with the complexities of the Drupal translation system. Hierarchy class \Twig_Node implements \Twig_NodeInterface class \Drupal\Core\Template\TwigNodeTrans See also http://twig.sensiolabs.org/doc/extensions/i18n.html https://github.com/fabpot/Twig-extensions File core/lib/Drupal/Core/Template/TwigNodeTrans.php, line 15 Name

TwigNodeTrans::compile

public TwigNodeTrans::compile(\Twig_Compiler $compiler) Overrides Twig_Node::compile File core/lib/Drupal/Core/Template/TwigNodeTrans.php, line 32 Class TwigNodeTrans A class that defines the Twig 'trans' tag for Drupal. Namespace Drupal\Core\Template Code public function compile(\Twig_Compiler $compiler) { $compiler->addDebugInfo($this); $options = $this->getNode('options'); list($singular, $tokens) = $this->compileString($this->getNode('body')); $plural = NULL;

TwigNodeTrans::compileString

protected TwigNodeTrans::compileString(\Twig_Node $body) Extracts the text and tokens for the "trans" tag. Parameters \Twig_Node $body: The node to compile. Return value array Returns an array containing the two following parameters: string $text The extracted text. array $tokens The extracted tokens as new \Twig_Node_Expression_Name instances. File core/lib/Drupal/Core/Template/TwigNodeTrans.php, line 96 Class TwigNodeTrans A class that defines the Twig 'trans' tag for Drupal. Names

TwigNodeTrans::__construct

public TwigNodeTrans::__construct(\Twig_Node $body, \Twig_Node $plural = NULL, \Twig_Node_Expression $count = NULL, \Twig_Node_Expression $options = NULL, $lineno, $tag = NULL) Constructor. The nodes are automatically made available as properties ($this->node). The attributes are automatically made available as array items ($this['name']). Parameters array $nodes An array of named nodes: array $attributes An array of attributes (should not be nodes): int $lineno The line number: string $tag