public function archive() { $mapper = new Model_Mapper_Cache_Post(); $years = $mapper->fetchValidYears(); $string = ''; for ($year = $years['min_year']; $year <= $years['max_year']; $year++) { $string .= '<li><a title="' . $year . '" href="/blog/archive/' . $year . '/">' . $year . '</a></li>'; } return $string; }
public function recentBlogs($limit = 2) { $mapper = new Model_Mapper_Cache_Post(); $posts = $mapper->getRecentPosts($limit); $string = ''; foreach ($posts as $post) { $string .= '<li><a title="' . $post->title . '" href="/blog/view/' . urlencode($post->category->name) . '/' . urlencode($post->title) . '/">' . $post->title . '</a></li>'; } return $string; }