/** * 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"); } }
/** * 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"); } }