Skip to content

Instantly share code, notes, and snippets.

@anttih
Created August 2, 2009 17:20
Show Gist options
  • Save anttih/160141 to your computer and use it in GitHub Desktop.
Save anttih/160141 to your computer and use it in GitHub Desktop.
<?php
/**
*
* Runs after _forward
*
* @return void
*
*/
protected function _postRun()
{
parent::_postRun();
$this->tags = $this->_entries
->getRelated('tagmap')
->getModel()
->fetchAllTags();
if ($this->list) {
// how do we get latest?
$paging = $this->list->getPagerInfo();
if ($paging['page'] == 1) {
// we are on the first page
// use list as latest
$this->latest = $this->list;
}
}
// still no latest?
if (! $this->latest) {
// fetch first 10
$params = array(
'cols' => array('id', 'permalink', 'subj'),
'order' => 'published DESC',
'page' => 1,
'paging' => 10,
);
$this->latest = $this->_entries->fetchAll($params);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment