Pagination: Add getTotalRecords and getCurrentPageRecordsTotal |
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
$pager->getTotal() and $pager->getCurrentPage() ?
kenjis, we are talking about PageRenderer and not Pager. Rendering really does not contain methods. Only properties
Code: CodeIgniter\Pager\PagerRenderer {#156 ▼
Simple CI 4 project for beginners codeigniter-expenses
This is how I ended up doing it in my Blog.
PHP Code: <?php What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
We understand that. Fine. Try in bs_simple.php output the total number and the current page. Hm?
Simple CI 4 project for beginners codeigniter-expenses
Well if you follow my code you will see that it does work.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I'll repeat it too: You pass values through the controller, but the render does not contain them
PHP Code: // Add to your Controller.
Simple CI 4 project for beginners codeigniter-expenses
If you open up system\Pager you will see what it does.
PHP Code: public function getTotal(string $group = 'default'): int What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
No, no, no. Read post. I know how to work with Pager myself. The issue affects CodeIgniter\Pager\PagerRenderer
PHP Code: <?php
Simple CI 4 project for beginners codeigniter-expenses
|
Welcome Guest, Not a member yet? Register Sign In |