Documentation

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
author

Alexey Bobkov, Samuel Georges

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

Methods

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
Return values
mixed

Search results