Class yii\twig\html\CssStyle_TokenParser
Inheritance | yii\twig\html\CssStyle_TokenParser » yii\twig\html\BaseCss_TokenParser » Twig_TokenParser |
---|---|
Source Code | https://github.com/yiisoft/yii2-twig/blob/master/src/html/CssStyle_TokenParser.php |
Public Methods
Method | Description | Defined By |
---|---|---|
getNodeClass() | yii\twig\html\CssStyle_TokenParser | |
getTag() | yii\twig\html\CssStyle_TokenParser | |
parse() | yii\twig\html\BaseCss_TokenParser |
Method Details
public void getNodeClass ( ) |
public function getNodeClass()
{
return '\yii\twig\html\StyleClassNode';
}
Defined in: yii\twig\html\BaseCss_TokenParser::parse()
public void parse ( \Twig_Token $token ) | ||
$token |
public function parse(\Twig_Token $token)
{
$parser = $this->parser;
$stream = $parser->getStream();
$name = $stream->expect(Twig_Token::NAME_TYPE);
$operator = $stream->expect(Twig_Token::OPERATOR_TYPE);
$value = $parser->getExpressionParser()->parseExpression();
$stream->expect(Twig_Token::BLOCK_END_TYPE);
$nodeClass = $this->getNodeClass();
return new $nodeClass($name, $value, $operator, $token->getLine(), $this->getTag());
}