public function run() { if (isset($_GET['tag'])) { $query = Post::getAdapterForPosts($this->limit, $_GET['tag']); } else { $query = Post::getAdapterForPosts($this->limit); } $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', array('dpPosts' => $dpPosts)); }