class TwigTransTokenParser

A class that defines the Twig 'trans' token parser for Drupal.

The token parser converts a token stream created from template source code into an Abstract Syntax Tree (AST). The AST will later be compiled into PHP code usable for runtime execution of the template.

Hierarchy

See also

\Twig_TokenParser

http://twig.sensiolabs.org/doc/extensions/i18n.html

https://github.com/fabpot/Twig-extensions

File

core/lib/Drupal/Core/Template/TwigTransTokenParser.php, line 16

Namespace

Drupal\Core\Template

Members

Name Modifiers Type Description
TwigTransTokenParser::checkTransString protected function Ensure that any nodes that are parsed are only of allowed types.
TwigTransTokenParser::decideForEnd public function Detect the end of a 'trans' tag.
TwigTransTokenParser::decideForFork public function Detect a 'plural' switch or the end of a 'trans' tag.
TwigTransTokenParser::getTag public function
TwigTransTokenParser::parse public function
Twig_TokenParser::$parser protected property
Twig_TokenParser::setParser public function Sets the parser associated with this token parser.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Template!TwigTransTokenParser.php/class/TwigTransTokenParser/8.1.x