pagination

This commit is contained in:
2024-07-31 14:51:39 +03:00
parent 1714afcf3f
commit 647fe34d11
3 changed files with 26 additions and 15 deletions

View File

@ -14,12 +14,12 @@ class Pagination
private string $baseUrl;
// public function __construct($countItem, $perPage, $currentPage, $baseUrl)
public function __construct(int $countItem, array $params, string $baseUrl)
public function __construct($countItem, $perPage, $currentPage, $baseUrl)
// public function __construct(int $countItem, array $params, string $baseUrl)
{
$this->countItem = $countItem;
$this->perPage = $params['perPage'];
$this->currentPage = $params['currentPage'];
$this->perPage = $perPage;
$this->currentPage = $currentPage;
$this->baseUrl = $baseUrl;
$this->countPages = ceil($this->countItem / $this->perPage);