CodeIgniter Forums
How to use the pagination with view parser? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: How to use the pagination with view parser? (/thread-74713.html)



How to use the pagination with view parser? - luispastendev - 10-28-2019

Hello there!
I am building a view with pagination with view parser, the problem is how I spend the value of pager to build my links? since it is an object and in view parser it is not possible to use them
Code:
$data = [
    'rows' => $this->model->paginate(2),
    'pager' => $this->model->pager
];
grettings!


RE: How to use the pagination with view parser? - ciadmin - 10-28-2019

At the bottom of the UG page (https://codeigniter4.github.io/userguide/libraries/pagination.html), a pagination objet will have `links()` that you can inject into your view at the proper place.

I thought there was something inside the Model class as well, but it isn't jumping out at me.


RE: How to use the pagination with view parser? - deepakkushwaha - 10-29-2019

Not having idea how to do it... If you find the solution please tell me too.