コード例 #1
0
ファイル: Sections.php プロジェクト: vinelab/agency
 /**
  * @return \Illuminate\Database\Eloquent\Model|null
  */
 public function currentCategory()
 {
     // We don't want to go through anything if there's no category
     if (!Input::has('category') || !Input::get('category')) {
         return null;
     }
     $alias = Input::get('category');
     $section = $this->sections->findByAlias($alias);
     // Cache the current section so that whenever someone asks for it we return
     // it right away without requesting it again.
     $this->setCurrentCategory($section);
     return $this->getCurrentCategory();
 }
コード例 #2
0
ファイル: SectionController.php プロジェクト: vinelab/agency
 /**
  * Display the specified resource.
  *
  * @param  string  $alias
  * @return Response
  */
 public function show($alias)
 {
     return $this->sections->findByAlias($alias);
 }