Hello
I have used the search function of the forum, searching by title with various queries,
but I can't find a thread that helps with the subject BUT I see many pagination threads so it looks like that pagination is an HOT TOPIC
I feel that, for a Codeigniter newbie, this is one of the trickier topics
together with turning the mind to the MVC and to the mechanism of calling controllers through the CI URLs mechanism
The idea is ALSO to UPDATE THE PAGINATION CONCEPTS to the CURRENT Codeigniter 3.1.10
since out there , the infos are a great confused mixture of the various CI versions. Is this the Most Important Codeigniter Forum? Isn't it? So let's make order :-)
Here it comes this thread where I kindly ask:
Are there some gentle CI guru that may show a bunch of frequent pagination with filtering situations best practices?
Yes it requires time, sharing is caring, and fills the souls. I teach and I like teaching and see students understanding the point. If I were a Codeigniter guru, I would take the time to fill the below sections by myself
![Confused Confused]()
but I'm a CI newbie
What I wish is that some
CI guruS of good will, will develop/add/share THE GOOD example in a CONTEMPORARY "
Codeigniter the Right Way Style" :-)
which also (to me) mean to kindly teach good advices on
how to project the URL structure for the controllers and methods
BEFORE to begin coding
AND OR about routes in the
routes.php and whatever else could be involved
![Idea Idea]()
and where an hypothetical CI FORUM GURU's COUNCIL will check the entries and eventually discuss and add modifications
Thank you in advance to those developers that will take the time to teach to people.
Here you the first common situations that comes to my mind
1. FILTER RESULTS WITHOUT PASSING QUERY PARAMETERS FILTERS
As it may suggest the title of this first situation, the view evoked by this controller will always show a paginated result with a prefixed query
PHP Code:
$this->db->where('ticketstatus', 0);
$this->db->join('dept', 'dept.id = ticket.dept_id');
$this->db->order_by('lastactivity', 'DESC');
$this->db->limit(200);
In current Codeigniter 3.1.10 which is the best practice to show pagination with a fixed filters set?
I mean in the wide meaning, so it also mean which is the suggested better practice to structure the project
- VC only or MVC
- use query builder or the queries strings
2. PAGINATION PASSING QUERY PARAMETERS SERVER SIDE
Mean within the code without user interaction
3. PAGINATION PASSING QUERY PARAMETERS CLIENT SIDE - ALLOW THE USER TO FILTER THE RESULTS
Here the situation is that we are showing to the user e.g. the table of the customers of an international company and we allow him to filter the HUGE list
so in the view he will have some dropdown where to select the nation, male/female, age range
and when he clicks to change the pagination page the filter is still applied
4. ...
5. ...
Thank you for teaching the right way to use Codeigniter pagination and if in Codeigniter 4 pagination is going to change, also thank you for advices on that
I wish this could become a useful thread for newbies ( like I'm )
Cor