custom column

This commit is contained in:
2024-07-31 17:11:29 +03:00
parent 8bc8a75a53
commit 320e1070ba
4 changed files with 63 additions and 29 deletions

View File

@ -22,7 +22,7 @@ class Pagination
/**
* @throws Exception
*/
public function __construct(array $options,)
public function __construct(array $options)
{
if (!$options['countItem']) {
throw new Exception(message: "countItem is not valid");
@ -30,7 +30,7 @@ class Pagination
$this->countItem = $options['countItem'];
$this->perPage = $options['perPage'] ?? 10;
$this->currentPage = $options['currentPage'] ?? 1;
$this->baseUrl = $options['baseUrl'];
$this->baseUrl = $options['baseUrl'] ?? '';
$this->baseUrl .= $options['prefix'] ?? '/page';
$this->countPages = ceil($this->countItem / $this->perPage);