public function executeArchives() { $rs = PostPeer::getArchivesRS(); $months = array(); while ($rs->next()) { $month = array(); $month['m'] = $rs->getInt('m'); $month['y'] = $rs->getInt('y'); $month['f'] = strftime('%B %Y', strtotime(sprintf('%d-%d-01', $month['y'], $month['m']))); $months[] = $month; } $this->months = $months; $this->limit = sfConfig::get('app_menu_max_archives_links'); $this->count = count($months); $this->max = $this->count > $this->limit ? $this->limit : $this->count; }