Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
fiktivkod/application/modules/blog/controllers/ArchiveController.php
2011-02-26 14:16:40 +01:00

28 lines
No EOL
636 B
PHP

<?php
class Blog_ArchiveController extends Fiktiv_Controller_Action
{
public function indexAction()
{
$blogposts = new ModelBlogPost();
$this->view->postsByMonthYear = $blogposts->findByMonth();
}
public function filterAction()
{
$params = $this->_getAllParams();
$blogposts = new ModelBlogPost();
if (array_key_exists('date', $params)) {
$this->view->posts = $blogposts->findByDate($params['date'], '%Y-%MM');
} else if (array_key_exists('tag', $params)) {
$this->view->posts = $blogposts->findByTag($params['tag']);
}
}
}