Multiple filters in route codeigniter 4 |
Hi everyone, I applied multiple filters in my codeigniter 4 route, more precisely I applied 2 filters for one route. an example like this:
Code: $routes->get('beranda/administrator', 'Administrator::beranda', ['filter' => 'auth', 'filter' => 'admin']); The filter works as I want, but only 1 filter works, namely the last filter: ['filter' => 'admin'] and for ['filter' => 'auth'] it doesn't work. I've also changed my code to: Code: $routes->get('beranda/administrator', 'Administrator::beranda', ['filter' => 'auth'] ,['filter' => 'admin']); It's the same only one filter works. I want to ask how to apply 2 filters at once on 1 route and I just use the before function on each of those filters. ? |
Messages In This Thread |
Multiple filters in route codeigniter 4 - by Rivaldy Saputra Agus - 03-22-2021, 08:06 PM
RE: Multiple filters in route codeigniter 4 - by kenjis - 03-23-2021, 07:52 PM
RE: Multiple filters in route codeigniter 4 - by Rivaldy Saputra Agus - 03-26-2021, 03:42 PM
|