示例#1
0
 public function compile(\Xtpl\Compiler $compiler, $cwd)
 {
     if (!$this->isCompiled()) {
         if ($this->hasAttribute('EXTENDS')) {
             $extendPath = $cwd . DIRECTORY_SEPARATOR . $this->getAttribute('EXTENDS');
             $xtpl = $compiler->compileFile($extendPath);
             //Incorporate trees
             $xtpl->addChild($this);
         }
     }
     return parent::compile($compiler, $cwd);
 }
示例#2
0
 public function compile(\Xtpl\Compiler $compiler, $cwd)
 {
     if (!$this->isCompiled()) {
         if ($this->hasAttribute('FILE')) {
             $includePath = $cwd . DIRECTORY_SEPARATOR . $this->getAttribute('FILE');
             $xtpl = $compiler->compileFile($includePath);
             //Apply arguments on templates (Even on extended ones, yay!)
             $this->applyArgs($xtpl);
             $this->addChild($xtpl);
         }
     }
     return parent::compile($compiler, $cwd);
 }