Archived
1
0
Fork 0

some blog work

This commit is contained in:
Fredric N 2011-02-26 14:16:40 +01:00
parent a60ffcee92
commit 44fb3e694c
6 changed files with 54 additions and 35 deletions

View file

@ -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']);
}
}
}