class Twig_Token
Represents a Token.
Constants
| EOF_TYPE |
|
| TEXT_TYPE |
|
| BLOCK_START_TYPE |
|
| VAR_START_TYPE |
|
| BLOCK_END_TYPE |
|
| VAR_END_TYPE |
|
| NAME_TYPE |
|
| NUMBER_TYPE |
|
| STRING_TYPE |
|
| OPERATOR_TYPE |
|
| PUNCTUATION_TYPE |
|
| INTERPOLATION_START_TYPE |
|
| INTERPOLATION_END_TYPE |
|
Methods
|
__construct(integer $type, string $value, integer $lineno)
Constructor. |
||
| string |
__toString()
Returns a string representation of the token. |
|
| Boolean |
test(array|integer $type, array|string|null $values = null)
Tests the current token for a type and/or a value. |
|
| integer |
getLine()
Gets the line. |
|
| integer |
getType()
Gets the token type. |
|
| string |
getValue()
Gets the token value. |
|
| static string |
typeToString(integer $type, Boolean $short = false, integer $line = -1)
Returns the constant representation (internal) of a given type. |
|
| static string |
typeToEnglish(integer $type, integer $line = -1)
Returns the english representation of a given type. |
Details
at line 45
public
__construct(integer $type, string $value, integer $lineno)
Constructor.
at line 57
public string
__toString()
Returns a string representation of the token.
at line 75
public Boolean
test(array|integer $type, array|string|null $values = null)
Tests the current token for a type and/or a value.
Parameters may be:
* just type
* type and value (or array of possible values)
* just value (or array of possible values) (NAME_TYPE is used as type)
at line 94
public integer
getLine()
Gets the line.
at line 104
public integer
getType()
Gets the token type.
at line 114
public string
getValue()
Gets the token value.
at line 128
static public string
typeToString(integer $type, Boolean $short = false, integer $line = -1)
Returns the constant representation (internal) of a given type.
at line 185
static public string
typeToEnglish(integer $type, integer $line = -1)
Returns the english representation of a given type.