class Pagination { public $total = 0; public $page = 1; public $limit = 20; public $num_links = 8; public $url = ''; public $text_first = '|<'; public $text_last = '>|'; public $text_next = '>'; public $text_prev = '<'; public function prevnext() { $total = is_numeric($this->total) ? (int)$this->total : 0; $page = is_numeric($this->page) ? (int)$this->page : 1; $limit = is_numeric($this->limit) && $this->limit > 0 ? (int)$this->limit : 10; $num_pages = ceil($total / $limit); $output = array(); if ($page > 1) { $output[] = array("rel" => "prev", "href" => str_replace('{page}', $page - 1, $this->url)); } if ($page < $num_pages) { $output[] = array("rel" => "next", "href" => str_replace('{page}', $page + 1, $this->url)); } return $output; } public function render() { $total = is_numeric($this->total) ? (int)$this->total : 0; $page = is_numeric($this->page) ? (int)$this->page : 1; $limit = is_numeric($this->limit) && $this->limit > 0 ? (int)$this->limit : 10; $num_pages = ceil($total / $limit); if (empty($this->url)) { $this->url = '#'; // Default to prevent errors } $this->url = str_replace('%7Bpage%7D', '{page}', $this->url); $output = ''; return $num_pages > 1 ? $output : ''; } }
Fatal error: Uncaught Error: Class 'Pagination' not found in /var/www/storage/modification/catalog/controller/product/category.php:504 Stack trace: #0 /var/www/storage/modification/system/engine/action.php(79): ControllerProductCategory->index() #1 /var/www/html/catalog/controller/startup/router.php(25): Action->execute() #2 /var/www/storage/modification/system/engine/action.php(79): ControllerStartupRouter->index() #3 /var/www/storage/modification/system/engine/router.php(134): Action->execute() #4 /var/www/storage/modification/system/engine/router.php(123): Router->execute() #5 /var/www/html/system/framework.php(169): Router->dispatch() #6 /var/www/html/system/startup.php(104): require_once('/var/www/html/s...') #7 /var/www/html/index.php(34): start() #8 {main} thrown in /var/www/storage/modification/catalog/controller/product/category.php on line 504