CodeIgniter Forums
Route filter enquiry - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: Route filter enquiry (/thread-73566.html)



Route filter enquiry - scalla - 05-09-2019

Good day all, I'll like to know if the route filter can take multiple filter. 

Example
PHP Code:
$routes->group('admin', ['filter' => 'auth:staff|role:admin,superadmin'], function($routes) {
 
   ...
}); 

The "|" separates the two filters.


RE: Route filter enquiry - MGatner - 05-14-2019

This is not currently supported. Filters is looking only for the name separated by a colon:
https://github.com/codeigniter4/CodeIgniter4/blob/develop/system/Filters/Filters.php#L294

If you'd like to work up a PR for this I'm sure the devs would review it.