Exemplo n.º 1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $search = trim(Input::get('q'));
     if ($search) {
         $posts = $this->posts->search(Input::get('q'), Config::get('wardrobe.per_page'));
     } else {
         $posts = $this->posts->active(Config::get('wardrobe.per_page'));
     }
     return View::make($this->theme . '.archive', compact('posts', 'search'));
 }
Exemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     $posts = $this->posts->active(100);
     $data = array('posts' => $posts, 'updated' => isset($posts[0]) ? $posts[0]->atom_date : date('Y-m-d H:i:s'));
     return Response::view('themes.' . $this->theme . '.atom', $data, 200, array('Content-Type' => 'application/rss+xml; charset=UTF-8'));
 }
Exemplo n.º 3
0
 /**
  * Fetch Posts
  *
  * @param array $params
  * @return Posts
  */
 public function posts($params = array())
 {
     $per_page = isset($params['per_page']) ? $params['per_page'] : Config::get('wardrobe.per_page');
     return $this->postsRepo->active($per_page);
 }
Exemplo n.º 4
0
 /**
  * Get the Wardrobe index.
  *
  * @return Response
  */
 public function getIndex()
 {
     $posts = $this->posts->active(Config::get('wardrobe.per_page'));
     return View::make('themes.' . $this->theme . '.index', compact('posts'));
 }