PHP Class Bolt\Twig\SwitchTokenParser

Usage: {% set foo = 1 %} {% switch foo %} {% case 1 %} Foo was equal to the number one. {% case 2 %} Foo was two. {% default %} This is the default fallback. {% endswitch %}
Inheritance: extends Twig_TokenParser
Show file Open project: bolt/bolt

Public Methods

Method Description
decideIfEnd ( Twig_Token $token ) : boolean
decideIfFork ( Twig_Token $token ) : boolean
getTag ( ) : string Gets the tag name associated with this token parser.
parse ( Twig_Token $token ) : Twig_Node Parses a token and returns a node.

Method Details

decideIfEnd() public method

public decideIfEnd ( Twig_Token $token ) : boolean
$token Twig_Token
return boolean

decideIfFork() public method

public decideIfFork ( Twig_Token $token ) : boolean
$token Twig_Token
return boolean

getTag() public method

Gets the tag name associated with this token parser.
public getTag ( ) : string
return string The tag name

parse() public method

Parses a token and returns a node.
public parse ( Twig_Token $token ) : Twig_Node
$token Twig_Token A Token instance
return Twig_Node A Twig node instance