some blog work
This commit is contained in:
parent
a60ffcee92
commit
44fb3e694c
6 changed files with 54 additions and 35 deletions
|
|
@ -4,7 +4,8 @@ class Blog_ArchiveController extends Fiktiv_Controller_Action
|
|||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->view->postsByMonthYear = $this->dataService->BlogPost->findByMonth();
|
||||
$blogposts = new ModelBlogPost();
|
||||
$this->view->postsByMonthYear = $blogposts->findByMonth();
|
||||
}
|
||||
|
||||
public function filterAction()
|
||||
|
|
@ -12,15 +13,16 @@ class Blog_ArchiveController extends Fiktiv_Controller_Action
|
|||
|
||||
$params = $this->_getAllParams();
|
||||
|
||||
$blogposts = new ModelBlogPost();
|
||||
|
||||
if (array_key_exists('date', $params)) {
|
||||
|
||||
$this->view->posts = $this->dataService->BlogPost->findByDate($params['date']);
|
||||
$this->view->posts = $blogposts->findByDate($params['date'], '%Y-%MM');
|
||||
|
||||
} else if (array_key_exists('tag', $params)) {
|
||||
|
||||
$this->view->posts = $this->dataService->BlogPost->findByTag($params['tag']);
|
||||
$this->view->posts = $blogposts->findByTag($params['tag']);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in a new issue