コード例 #1
0
ファイル: Archive.php プロジェクト: kminkov/Blog
 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;
 }
コード例 #2
0
ファイル: RecentBlogs.php プロジェクト: kminkov/Blog
 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;
 }