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

Public Methods

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

decideIfEnd()

View source

Arguments

  • $token

Returns

mixed

Signature

public mixed decideIfEnd ( $token )

decideIfFork()

View source

Arguments

  • $token

Returns

mixed

Signature

public mixed decideIfFork ( $token )

getTag()

Gets the tag name associated with this token parser.

View source

Returns

string

Signature

public string getTag ( )

parse()

Parses a token and returns a node.

View source

Arguments

  • $token (\Twig_Token)

Returns

Craft\Switch_Node

Throws

  • \Twig_Error_Syntax

Signature

public Craft\Switch_Node parse ( \Twig_Token $token )