Twig_Environment::getLexer PHP 메소드

getLexer() 공개 메소드

Gets the Lexer instance.
public getLexer ( ) : Twig_LexerInterface
리턴 Twig_LexerInterface A Twig_LexerInterface instance
    public function getLexer()
    {
        if (null === $this->lexer) {
            $this->lexer = new Twig_Lexer($this);
        }

        return $this->lexer;
    }

Same methods

Twig_Environment::getLexer ( )

Usage Example

예제 #1
0
 public static function getLineAndFile()
 {
     $o = self::$env->getLexer();
     $c = new \ReflectionClass(get_class($o));
     foreach ($c->getProperties() as $p) {
         if ($p->name == 'lineno') {
             $p->setAccessible(true);
             $lineno = $p->getValue($o);
         }
         if ($p->name == 'filename') {
             $p->setAccessible(true);
             $filename = $p->getValue($o);
         }
     }
     return $lineno . ' ' . trim($filename);
 }
All Usage Examples Of Twig_Environment::getLexer