Example #1
0
 /**
  * @param Template $template
  * @param $params
  * @throws \Exception
  */
 public function bootTemplate($template, $params)
 {
     if (!$template->isBootExists()) {
         throw new \Exception('No boot for template');
     }
     $bootData = $this->logicProcessor->processBootLogic($template, $params);
     if ($bootData->getExtend() != null) {
         /** @var Template $parent */
         $parent = $this->templateFactory->getTemplate($bootData->getExtend());
         $template->setParent($parent);
         $parent->setChild($template);
         if ($parent->isBootExists()) {
             $this->bootTemplate($parent, $params);
         }
     }
 }
Example #2
0
 /**
  * @param Template $template
  * @param $blockName
  * @param $params
  * @return mixed
  */
 public function processBlockLogic($template, $blockName, $params)
 {
     return eval($this->getLogicText($template->getBlockLogic($blockName), 'Jte\\Language\\BlockLogic'));
 }