Пример #1
0
 /**
  * @param ClassNode $node
  */
 private function setupTemplateDefaults(ClassNode $node)
 {
     if ($this->autofilter === 1) {
         $this->extension = $this->getExtension($node->getTemplateName());
         $this->autofilterStack[] = $this->autofilter;
         $this->autofilter = $this->extension;
     }
 }
Пример #2
0
 public function parseTemplate(Stream $stream, $templateName)
 {
     $fileNode = new FileNode($this->environment);
     $this->fileNode = $fileNode;
     $this->classNode = $fileNode->addClass($templateName);
     $this->classNode->addChild($this->parseBlock($stream, null, Token::EOF), ClassNode::MAIN_TEMPLATE_BLOCK);
     return $fileNode;
 }
Пример #3
0
 private function isBlockRoot(Node $node)
 {
     if (!isset($this->currentClassNode)) {
         return false;
     }
     if (!$node instanceof RootNode) {
         return false;
     }
     return in_array($node, $this->currentClassNode->getChildren(), true);
 }
Пример #4
0
 public function testGetNameSpace()
 {
     $this->assertEquals('Test', $this->node->getNameSpace());
 }