Lines Matching refs:tag
42 You can use a ``lipsum`` *tag*:
48 That works, but using a tag for ``lipsum`` is not a good idea for at least
52 * The tag outputs something;
53 * The tag is not flexible as you cannot use it in an expression:
107 *tag* complex rare DSL language construct
368 Let's create a simple ``set`` tag that allows the definition of simple
369 variables from within a template. The tag can be used like follows:
381 The ``set`` tag is part of the Core extension and as such is always
386 Three steps are needed to define a new tag:
392 * Registering the tag.
394 Registering a new tag
397 Adding a tag is as simple as calling the ``addTokenParser`` method on the
428 The ``getTag()`` method must return the tag we want to parse, here ``set``.
431 tag. It should return a ``\Twig\Node\Node`` instance that represents the node (the
452 the ``set`` tag.
466 … function __construct($name, \Twig\Node\Expression\AbstractExpression $value, $lineno, $tag = null)
468 parent::__construct(['value' => $value], ['name' => $name], $lineno, $tag);
771 Adding a tag in an extension can be done by overriding the
785 In the above code, we have added a single new tag, defined by the
787 responsible for parsing the tag and compiling it to PHP.