예제 #1
0
 /**
  * define page title and load template files
  */
 public function index($category_title, $category_slug)
 {
     $this->data['title'] = 'Manage Posts';
     $total = count(PostModel::category($category_title, $category_slug));
     $pages = new Paginator('4', 'p');
     $this->data['post_content'] = PostModel::category($category_title, $category_slug, $pages->getLimit());
     $pages->setTotal($total);
     $path = DIR . 'post/' . $category_title . '/' . $category_slug . '?';
     $this->data['page_links'] = $pages->pageLinks($path, null);
     View::rendertemplate('header', $this->data);
     View::rendertemplate('sidebar', $this->data);
     View::render('post/post.index', $this->data);
     View::rendertemplate('footer', $this->data);
 }