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);
         }
     }
 }