Auto Routing Improved doesn't work for getIndex with parameters |
I enabled Auto Routing improved and trying to follow the manuals. I want to add pagination to my clients list:
Code: <?php However even with auto routing enabled /clients/13 results in error 404
Sorry, you can't do like that.
Because the URI corresponding to default method (index) must be omitted. In other words, you cannot have parameters in `getIndex()`. If you want to go `/clients/13`, you need to have `get13()` method in your controller. If you have `getP($page = 1)` method, you can go `/clients/p/13`.
My bad. When I just discovered CodeIgniter I didn't know it already has a pagination class. https://codeigniter.com/user_guide/libra...ation.html
No problem.
I sent an enhancement PR for Auto Routing Improved. See https://github.com/codeigniter4/CodeIgniter4/pull/7162 |
Welcome Guest, Not a member yet? Register Sign In |