public function doRenderPage($slug = '') { if ($slug == '') { $slug = $this->config->homepage; } $page = Page::where('slug', $slug)->get(); $theme = $this->config->theme; if ($page == null) { return redirect()->route('ct_frontend_not_found'); } else { $page = $page[0]; return $this->renderHtml('frontend.page', $page->title, ['page' => $page, 'theme' => $theme], 'cmstwoThemer'); } }
public static function getPage($slug) { $page = Page::where('slug', $slug)->first(); $out = new \stdClass(); $out->title = $page->title; $out->slug = $page->slug; $out->description = $page->description; $content = ""; foreach ($page->content as $section) { $content .= $section->content; } $out->content = $content; return $out; }