Пример #1
0
 /**
  * {@inheritdoc}
  */
 protected function doLeaveNode(Apishka_Templater_NodeAbstract $node, Apishka_Templater_Environment $env)
 {
     if ($node instanceof Apishka_Templater_Node_Module) {
         $varName = $this->getVarName();
         $node->setNode('display_start', Apishka_Templater_Node::apishka(array(new Apishka_Templater_Profiler_Node_EnterProfile($this->extensionName, Apishka_Templater_Profiler_Profile::TEMPLATE, $node->getAttribute('filename'), $varName), $node->getNode('display_start'))));
         $node->setNode('display_end', Apishka_Templater_Node::apishka(array(new Apishka_Templater_Profiler_Node_LeaveProfile($varName), $node->getNode('display_end'))));
     } elseif ($node instanceof Apishka_Templater_Node_Block) {
         $varName = $this->getVarName();
         $node->setNode('body', Apishka_Templater_Node_Body::apishka(array(new Apishka_Templater_Profiler_Node_EnterProfile($this->extensionName, Apishka_Templater_Profiler_Profile::BLOCK, $node->getAttribute('name'), $varName), $node->getNode('body'), new Apishka_Templater_Profiler_Node_LeaveProfile($varName))));
     }
     return $node;
 }
Пример #2
0
 public function setBlock($name, Apishka_Templater_Node_Block $value)
 {
     $this->blocks[$name] = Apishka_Templater_Node_Body::apishka(array($value), array(), $value->getLine());
 }