From 9ac695ad8829dbeff200c7b48693846b68f88f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Wed, 9 Apr 2025 16:31:20 +0900 Subject: [PATCH] dbms_primeidc_init...1 --- extdbms/lib/Utils/Pagination.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) 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;