Switch_TokenParser

Type
Class
Namespace
Craft
Inherits
Craft\Switch_TokenParser » Twig_TokenParser
Since
1.3

Class Switch_TokenParser that parses {% switch %} tags.

Based on the rejected Twig pull request: https://github.com/fabpot/Twig/pull/185

See also http://craftcms.com

View source (opens new window)

# Public Methods

Method Description
decideIfEnd()
decideIfFork()
getTag() Gets the tag name associated with this token parser.
parse() Parses a token and returns a node.

# decideIfEnd()

View source (opens new window)

Arguments

  • $token

Returns

mixed

Signature

public mixed decideIfEnd ( $token )

# decideIfFork()

View source (opens new window)

Arguments

  • $token

Returns

mixed

Signature

public mixed decideIfFork ( $token )

# getTag()

Gets the tag name associated with this token parser.

View source (opens new window)

Returns

string (opens new window)

Signature

public string getTag ( )

# parse()

Parses a token and returns a node.

View source (opens new window)

Arguments

  • $token (\Twig_Token)

Returns

Craft\Switch_Node

Throws

  • \Twig_Error_Syntax

Signature

public Craft\Switch_Node parse ( \Twig_Token $token )