Esempio n. 1
0
 public function compile()
 {
     if ($this->resource === null) {
         throw new TemplateException('Template has no resource to load. Oops.');
     }
     if ($this->compiled === null) {
         $this->compiled = $this->compiler->run($this->resource, $this->resourceList);
     }
     return $this->compiled;
 }
Esempio n. 2
0
 public function renderCommonNode(ICompiler $compiler, IPiccoNode $node)
 {
     if ($node->getMeta('void', false) === true) {
         return $compiler->renderer('void-common-node', $node);
     }
     $source = ($nodeName = $node->getName()) ? '<' . $nodeName . $compiler->renderer('common-attributes', $node) . '>' : null;
     foreach ($node->getNodeList() as $children) {
         $source .= $compiler->node($children);
     }
     $source .= $nodeName ? '</' . $nodeName . '>' : null;
     return $source;
 }