示例#1
0
 public function compile(Compiler $compiler)
 {
     if ($compiler->getEnvironment()->getOption('debug')) {
         $compiler->indented('//Line %d: %s tag', $this->getData('line'), $this->tag->getTag());
     }
     $this->tag->compile($compiler, $this);
 }
示例#2
0
 public function compile(Compiler $compiler)
 {
     if ($this->getObject()) {
         $compiler->compileNode($this->getObject())->add('->' . $this->getData('name'))->compileArgumentList($this->arguments);
     } else {
         $environment = $compiler->getEnvironment();
         $function = $environment->getFunction($this->getData('name'));
         if ($function->getOption('needs_environment')) {
             array_unshift($this->arguments, new TempVariableNode('environment'));
         }
         if ($function->getOption('needs_context')) {
             array_unshift($this->arguments, new TempVariableNode('context'));
         }
         $environment->getFunctionCompiler($function->getOption('compiler'))->compile($compiler, $function, $this->arguments);
     }
 }