Exemple #1
0
 /**
  * define page title and load template files
  */
 public function index()
 {
     $this->data['title'] = 'Manage Categories';
     $category_model = new \Models\Category();
     $total = count($category_model->all());
     $pages = new Paginator('10', 'p');
     $this->data['category'] = $category_model->group($pages->getLimit());
     $pages->setTotal($total);
     $path = DIR . 'category?';
     $this->data['page_links'] = $pages->pageLinks($path, null);
     View::rendertemplate('header', $this->data);
     View::rendertemplate('sidebar', $this->data);
     View::render('category/category.index', $this->data);
     View::rendertemplate('footer', $this->data);
 }