![]() |
Pagination: Add getTotalRecords and getCurrentPageRecordsTotal - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29) +--- Thread: Pagination: Add getTotalRecords and getCurrentPageRecordsTotal (/showthread.php?tid=88174) |
Pagination: Add getTotalRecords and getCurrentPageRecordsTotal - Tanveer - 08-02-2023 Hello, This is my first post So as we are not getting the total records and current page records in pager library to the template from pagerRenderer.php I can workaround for total records by adding this to pagerRenderer.php : Code: public function getTotalRecordsCount(): int please add them so we can show bottom of the table the counts of records I also want to ask if there is way list S.No. (numbers) like we do within foreach loop as $i=1 and in the $i++; sorry if there is already a solution RE: Pagination: Add getTotalRecords and getCurrentPageRecordsTotal - kenjis - 08-02-2023 $pager->getTotal() and $pager->getCurrentPage() ? RE: Pagination: Add getTotalRecords and getCurrentPageRecordsTotal - Tanveer - 08-03-2023 (08-02-2023, 11:25 PM)kenjis Wrote: $pager->getTotal() and $pager->getCurrentPage() ? doesn't work as I am talking about to use them on pager template and we need $pager->getCurrentPageRecords(); not $pager->getCurrentPage(); RE: Pagination: Add getTotalRecords and getCurrentPageRecordsTotal - ozornick - 08-03-2023 kenjis, we are talking about PageRenderer and not Pager. Rendering really does not contain methods. Only properties Code: CodeIgniter\Pager\PagerRenderer {#156 ▼ RE: Pagination: Add getTotalRecords and getCurrentPageRecordsTotal - InsiteFX - 08-03-2023 This is how I ended up doing it in my Blog. PHP Code: <?php RE: Pagination: Add getTotalRecords and getCurrentPageRecordsTotal - ozornick - 08-04-2023 We understand that. Fine. Try in bs_simple.php output the total number and the current page. Hm? RE: Pagination: Add getTotalRecords and getCurrentPageRecordsTotal - InsiteFX - 08-04-2023 Well if you follow my code you will see that it does work. RE: Pagination: Add getTotalRecords and getCurrentPageRecordsTotal - ozornick - 08-04-2023 I'll repeat it too: You pass values through the controller, but the render does not contain them PHP Code: // Add to your Controller. RE: Pagination: Add getTotalRecords and getCurrentPageRecordsTotal - InsiteFX - 08-05-2023 If you open up system\Pager you will see what it does. PHP Code: public function getTotal(string $group = 'default'): int RE: Pagination: Add getTotalRecords and getCurrentPageRecordsTotal - ozornick - 08-06-2023 No, no, no. Read post. I know how to work with Pager myself. The issue affects CodeIgniter\Pager\PagerRenderer PHP Code: <?php |