How to extend PagerRenderer and add additional methods |
Hello, I'm trying to extend pagination of codeigniter4, so I can be able to use it with ajax.
If I add directly my custom method to CodeIgniter\Pager\PagerRenderer, they works fine. But I want to use them through Libraries directory. So I can be able to use like this PHP Code: <?php //html navigation template PHP Code: <?php if ($pager->hasNext()) : ?> Thanks in advance.
It seems there is no way to replace the PagerRenderer class.
It is hard coded: https://github.com/codeigniter4/CodeIgni...r.php#L123
You could do it like this:
1. Extend the Pager class to use your PagerRenderer. 2. Replace the Pager class. See https://codeigniter4.github.io/CodeIgnit...re-classes
i extend HttpIncoing Class you follow patern to extend pageRender
see my codes PHP Code: <?php PHP Code: <?php PHP Code: <?php namespace Modules\Auth\Config; PHP Code: <?php easy peasy extend ci core
Enlightenment Is Freedom
|
Welcome Guest, Not a member yet? Register Sign In |