PutTokenParser
extends AbstractTokenParser
in package
Parser for the `{% put %}` Twig tag.
{% put head %} {% endput %}
or
{% put head %}
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet"/>
{% default %}
{% endput %}
Tags
Table of Contents
- $parser : Parser
- decidePutEnd() : mixed
- getTag() : string
- Gets the tag name associated with this token parser.
- parse() : Node
- Parses a token and returns a node.
- setParser() : mixed
- Sets the parser associated with this token parser.
Properties
$parser
protected
Parser
$parser
Methods
decidePutEnd()
public
decidePutEnd(Token $token) : mixed
Parameters
- $token : Token
Return values
mixed —getTag()
Gets the tag name associated with this token parser.
public
getTag() : string
Return values
string —The tag name
parse()
Parses a token and returns a node.
public
parse(Token $token) : Node
Parameters
- $token : Token
-
A TwigToken instance
Return values
Node —A Twig\Node\Node instance
setParser()
Sets the parser associated with this token parser.
public
setParser(Parser $parser) : mixed
Parameters
- $parser : Parser