Contents

Cms\Twig\TokenParser\PlaceholderTokenParser

Overview

PlaceholderTokenParser for the {% placeholder %} Twig tag.

Example usage:

{% placeholder head %}

Using default content:

{% placeholder head default %}
    <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet"/>
{% endplaceholder %}
Extends
  • Twig\TokenParser\AbstractTokenParser
Implements
  • Twig\TokenParser\TokenParserInterface

Protected Properties

There are no protected properties in the class.

Show inherited protected properties

Inherited Protected Properties

  • $parser - (defined in Twig\TokenParser\AbstractTokenParser)

Public Methods

public decidePlaceholderEnd()

public decidePlaceholderEnd($token): void

Determines if the token marks the end of the placeholder block.

public getTag()

public getTag(): string 

Returns the tag name associated with this token parser.

public parse()

public parse($token): PlaceholderNode 

Parses a token and returns a node.

Show inherited public methods

Inherited Public Methods

  • isAlwaysAllowedInSandbox() - (defined in Twig\TokenParser\AbstractTokenParser)
  • setParser() - (defined in Twig\TokenParser\AbstractTokenParser)

Protected Methods

protected loadParams()

protected loadParams($stream): void

Loads parameters from the stream.

Show inherited protected methods

Inherited Protected Methods

  • parseAssignmentExpression() - Parses an assignment expression like "a, b". (defined in Twig\TokenParser\AbstractTokenParser)