PutTokenParser

Parser for the {% put %} Twig tag.

 class Cms\Twig\PutTokenParser
extends Twig\TokenParser\AbstractTokenParser

{% put head %} {% endput %}

or

{% put head %}
    <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet"/>
    {% default %}
{% endput %}

Methods

public decidePutEnd (Twig\Token $token)

Parameters
Property Description
$token
Twig\Token
Returns
mixed

public getTag () : string

Gets the tag name associated with this token parser.

Returns
string

The tag name

public parse (Twig\Token $token) : Twig\Node\Node

Parses a token and returns a node.

Parameters
Property Description
$token
Twig\Token

A TwigToken instance

Returns
Twig\Node\Node

A Twig\Node\Node instance

Copyright © 2024 Winter CMS