/** * @return \Zend\View\Model\ViewModel */ public function listAction() { $slug = $this->params('slug'); $page = $this->params('page'); $category = $this->categoryRepository->findBySlug($slug); return new ViewModel(array('category' => $category, 'posts' => $this->postRepository->findByCategoryPaginated($category, $page))); }