\Twig_Token
Represents a Token.
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class Twig_Token
{
- // constants
- const EOF_TYPE = 1;
- const TEXT_TYPE = 0;
- const BLOCK_START_TYPE = 1;
- const VAR_START_TYPE = 2;
- const BLOCK_END_TYPE = 3;
- const VAR_END_TYPE = 4;
- const NAME_TYPE = 5;
- const NUMBER_TYPE = 6;
- const STRING_TYPE = 7;
- const OPERATOR_TYPE = 8;
- const PUNCTUATION_TYPE = 9;
- const INTERPOLATION_START_TYPE = 10;
- const INTERPOLATION_END_TYPE = 11;
- // methods
- public void __construct()
- public string __toString()
- public Boolean test()
- public integer getLine()
- public integer getType()
- public string getValue()
- public static string typeToString()
- public static string typeToEnglish()
Constants
Name | Value |
---|---|
EOF_TYPE | 1 |
TEXT_TYPE | 0 |
BLOCK_START_TYPE | 1 |
VAR_START_TYPE | 2 |
BLOCK_END_TYPE | 3 |
VAR_END_TYPE | 4 |
NAME_TYPE | 5 |
NUMBER_TYPE | 6 |
STRING_TYPE | 7 |
OPERATOR_TYPE | 8 |
PUNCTUATION_TYPE | 9 |
INTERPOLATION_START_TYPE | 10 |
INTERPOLATION_END_TYPE | 11 |
Members
protected
- $lineno
- $type
- $value
Methods
public
- __construct() — Constructor.
- __toString() — Returns a string representation of the token.
- getLine() — Gets the line.
- getType() — Gets the token type.
- getValue() — Gets the token value.
- test() — Tests the current token for a type and/or a value.
- typeToEnglish() — Returns the english representation of a given type.
- typeToString() — Returns the constant representation (internal) of a given type.