I need two paginations on one page, is it possible to do this with codeigniter?!? Of course they must operate independently of one another.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes and no. If you want two different pagination visuals (customized renderings of the library) then sure. The problem you’ll run into is by default the pagination library will pull the current page out of your
$ci->uri->segments()list automatically to determine which page to mark as “active”.I do not know of a way to explicitly override this. Perhaps if you made a
MY_Paginationthat took an additional$configvalue for current page you could get it to behave like that. I haven’t looked at the library’s code in a while so you’d have to do some digging.Honestly though, I’d suggest you build your own, it’s not incredibly hard to do some simple math to determine what numbers to link.
Also you’ll run into issues with CI’s Pagination Library if you want the “current page” part to be NOT the last segment in your url. This may have been fixed lately but last time I looked it was the stop-gap for me using the library all together.
Bottom Line Invest the time in making your own if you want more than it’s basic functionality, it’s simple enough, just make yours reusable if you can.