コード例 #1
0
 /**
  * Show a custom page
  * 
  * @param int      $id          The ID of the custom page
  * @param string   $slug        The unique slug
  * @param boolean  $isImpressum If true, render some special information
  * @return void
  */
 public function show($id, $slug = null, $isImpressum = false)
 {
     if ($id) {
         $customPage = CustomPage::whereId($id)->published()->firstOrFail();
     } else {
         $customPage = CustomPage::whereSlug($slug)->published()->firstOrFail();
     }
     $hasAccess = (user() and user()->hasAccess('internal'));
     if ($customPage->internal and !$hasAccess) {
         return $this->alertError(trans('app.access_denied'));
     }
     $customPage->access_counter++;
     $customPage->save();
     $this->title($customPage->title);
     $this->pageView('pages::show_custom_page', compact('customPage', 'isImpressum'));
 }
コード例 #2
0
 /**
  * Show the default imprint page that includes
  * infos about the CMS.
  * 
  * @return void
  */
 public function showImprint()
 {
     $imprintText = CustomPage::findOrFail(1)->text;
     $this->pageView('pages::imprint', compact('imprintText'));
 }