pagination |
How to use pagination through MySQL query instead of using just the Model name?
Controller code: PHP Code: namespace App\Controllers; PHP Code: namespace App\Models; NOTE: Please help me out using MYSQL query with user defined JOINS or UNION etc instead of using just the table name in Model (Table: users here). I want to use userdefined queries instead of mere table name and allowed fields
In your Controller
PHP Code: $pager = \Config\Services::pager(); In your Model, Overrite system function paginate PHP Code: public function paginate(int $perPage = null, string $group = 'default', int $page = null, int $segment = 0) This working fine for custom QUERY... Learning CI4 from my works, from errors and how to fix bugs in the community Love CI & Thanks CI Teams
Thank you so much nc03061981. Overwriting the system method is such a cool idea. God Bless You and CI Team.... Love...
I think CI4 have great Core System
User can overrite but core still working fine Thanks CI4 Team Learning CI4 from my works, from errors and how to fix bugs in the community Love CI & Thanks CI Teams
|
Welcome Guest, Not a member yet? Register Sign In |