Contents

Cms\Twig\TokenParser\PropsTokenParser

Overview

PropsTokenParser for the {% props %} Twig tag.

Declares which parameters are props (component data) vs attributes (HTML pass-through). Parameters not listed in props flow into an attributes variable (ComponentAttributeBag).

Example usage:

{% props {title: null, size: 'md'} %}
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 getTag()

public getTag(): string 

getTag returns the tag name associated with this token parser.

public parse()

public parse($token): PropsNode 

parse 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

Show inherited protected methods

Inherited Protected Methods

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