Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
 }