Ejemplo n.º 1
0
 public function run()
 {
     if (isset($_GET['tag'])) {
         $query = Post::getAdapterForPosts($this->limit * 5, $_GET['tag']);
     } elseif (isset($_GET['category'])) {
         $query = Post::getAdapterForPostsCatgory($this->limit * 5, $_GET['category']);
     } else {
         $query = Post::getAdapterForPosts($this->limit * 5);
     }
     $dpPosts = new ActiveDataProvider(array('query' => $query, 'pagination' => array('pageSize' => $this->limit)));
     //here we don't return the view, here we just echo it!
     return $this->render('@frenzelgmbh/sblog/widgets/views/_posts_styled', array('dpPosts' => $dpPosts));
 }