public function actionIndex($page = 1) { $page = (int) $page; $count = 10; $products = Product::getProductsList($count, $page, false); if (!$products) { $products = array(); } $total = Product::getTotalProducts(false); $pagination = FunctionLibrary::buildPagination($total, $count, $page, 'page-'); require_once ROOT . '/views/admin-product/index.php'; return true; }
public function actionCategory($categoryId, $page = 1) { $categories = Category::getCategoryList(); if (!$categories) { $categories = array(); } $page = (int) $page; $products = Product::getProductsByCategoryId($categoryId, $page); if (!$products) { $products = array(); } $total = Product::getTotalProductsInCategory($categoryId); $pagination = FunctionLibrary::buildPagination($page, $total, Product::SHOW_BY_DEFAULT, 'page-'); require_once ROOT . '/views/catalog/category.php'; return true; }
public function actionIndex($page = 1) { $page = (int) $page; $count = 6; $categories = Category::getCategoriesList(); if (!$categories) { $categories = array(); } $blogs = Blog::getAllBlogs($count, $page); if (!$blogs) { $blogs = array(); } $total = Blog::getTotalBlogs(); $pagination = FunctionLibrary::buildPagination($total, $count, $page, 'page-'); require_once ROOT . '/views/blog/index.php'; return true; }