/**
  * @param $categoryId
  * @param int $page
  * @return bool
  * Метод для вывода товаров категорий с нумерацией страниц
  */
 public function actionCategory($categoryId, $page = 1)
 {
     $categories = Category::getCategoriesList();
     $categoryProducts = Product::getProductListByCategory($categoryId, $page);
     $total = Product::getTotalProductsInCategory($categoryId);
     //общее кол-во товаров
     //создание постраничной навигации(общее кол-во товаров,текущая страница,на одной странице,ключ в роутах);
     $pagination = new Pagination($total, $page, 3, 'page-');
     $args = array('categories' => $categories, 'categoryProducts' => $categoryProducts, 'total' => $total, 'pagination' => $pagination, 'categoryId' => $categoryId);
     return self::render('category', $args);
 }
 public function actionCategory($categoryId, $page = 1)
 {
     $categories = array();
     $categories = Category::getCategoryList();
     $categoryProduct = array();
     $categoryProduct = Product::getProductListByCategory($categoryId, $page);
     $total = Product::getTotalProductsInCategory($categoryId);
     $pagination = new Pagination($total, $page, Product::SHOW_BY_DEFAULT, 'page-');
     require_once ROOT . '/views/catalog/category.php';
     return true;
 }
 public function actionCategory($categoryId, $page = 1)
 {
     $categores = array();
     $categores = Category::getCategoryList();
     $categoryProducts = array();
     $categoryProducts = Product::getProductListByCategory($categoryId, $page);
     // Общее количетсво товаров (необходимо для постраничной навигации)
     $total = Product::getTotalProductsInCategory($categoryId);
     // Создаем объект Pagination - постраничная навигация
     $pagination = new Pagination($total, $page, Product::SHOW_BY_DEFAULT, 'page-');
     require_once ROOT . '/sourse/views/catalog/category.php';
     return true;
 }