示例#1
0
 /**
  * Processes response for the handled CMS page
  *
  * @param Page $page
  * @return string
  * @throws \Exception
  */
 protected function processCmsPage(Page $page)
 {
     $dispatchedPage = $page->getDispatchedBlock();
     if ($dispatchedPage) {
         $view = $this->templatesProcessor->applyPageBlocksTemplates($dispatchedPage);
         $response = view($view, $this->templatesProcessor->getResultViewParams())->render();
         return $response;
     } else {
         throw new \Exception("No CMS page has been dispatched");
     }
 }
示例#2
0
 /**
  * Processes response for the handled CMS page
  *
  * @param Page $page
  * @throws \Exception
  */
 protected function processCmsPage(Page $page)
 {
     $dispatchedPage = $page->getDispatchedBlock();
     if ($dispatchedPage) {
         $this->setTemplatesProcessor(new TemplatesProcessor('default.blade.php'));
         $this->rawView = $this->templatesProcessor->applyPageBlocksTemplates($dispatchedPage);
         $this->renderer = new Renderer($this->templatesProcessor->getResultViewParams());
         $this->renderer->setNavigationItems($page->getNavigationItems());
     } else {
         throw new \Exception("No CMS page has been dispatched");
     }
 }