diff --git a/extdbms/lib/Utils/Pagination.php b/extdbms/lib/Utils/Pagination.php index 5e5efac..1bcff34 100644 --- a/extdbms/lib/Utils/Pagination.php +++ b/extdbms/lib/Utils/Pagination.php @@ -8,6 +8,7 @@ class Pagination public int $perPage; public int $totalItems; public int $totalPages; + public int $groupSize = 10; public int $start; public int $end; @@ -17,9 +18,9 @@ class Pagination $this->perPage = $perPage; $this->currentPage = max(1, $currentPage); $this->totalPages = (int)ceil($totalItems / $perPage); - $this->start = ($this->currentPage - 1) * $perPage; $this->end = min($this->start + $perPage, $totalItems); + $this->groupSize = $_ENV['VIEW_LIST_PAGINATION_GROUPSIZE'] ?? $_SERVER['VIEW_LIST_PAGINATION_GROUPSIZE'] ?? 10; } public function hasPrevious(): bool @@ -71,20 +72,24 @@ class Pagination public function render(string $baseUrl = '', array $query = []): string { if ($this->totalPages <= 1) { - return ''; // 페이지가 1개 이하면 렌더링 생략 + return ''; } $html = ''; return $html; } - private function pageLink(int $page, string $label, string $baseUrl, array $query): string { $query['page'] = $page;