Abstract Class yii\twig\html\BaseCss_TokenParser

Inheritanceyii\twig\html\BaseCss_TokenParser » Twig\TokenParser\AbstractTokenParser
Subclassesyii\twig\html\CssClass_TokenParser, yii\twig\html\CssStyle_TokenParser
Source Code https://github.com/yiisoft/yii2-twig/blob/master/src/html/BaseCss_TokenParser.php

Method Details

Hide inherited methods

getNodeClass() public abstract method

public abstract void getNodeClass ( )

                abstract public function getNodeClass();

            
parse() public method

public void parse ( \Twig\Token $token )
$token

                public function parse(Token $token)
{
    $parser = $this->parser;
    $stream = $parser->getStream();
    $name = $stream->expect(Token::NAME_TYPE);
    $operator = $stream->expect(Token::OPERATOR_TYPE);
    $value = $parser->getExpressionParser()->parseExpression();
    $stream->expect(Token::BLOCK_END_TYPE);
    $nodeClass = $this->getNodeClass();
    return new $nodeClass($name, $value, $operator, $token->getLine(), $this->getTag());
}