Avoid using CI4 filters |
I think this is one of the very poorly implimented features in CI4.
01. It's doesn't support for multiple filters for single route. 02. There is no support for chained filters like in the form validation. For this reason we have to do authentication like stuff in every filters and its get repeated in every filter. 03. There is no better way to know which route we are currently on in the filters. We have to do lots of if() block just to verify routes. So I suggest you to use old school type methods. like, Do stuff top of the controller method or end of the controller method. I know it's looks bad but it's much more simpler and well scale. Thanks.
You can combine multiple filters into one alias, making complex sets of filters simple to apply:
PHP Code: public $aliases = [ (02-28-2021, 07:38 PM)kenjis Wrote: You can combine multiple filters into one alias, making complex sets of filters simple to apply: But passing filter specific params for multiple filters is still a nightmare. |
Welcome Guest, Not a member yet? Register Sign In |