Controller Filters - Input needed |
07-10-2016, 10:18 PM
(This post was last modified: 07-10-2016, 10:21 PM by albertleao. Edit Reason: Bad formatting )
Interesting. I'm glad everyone seemed to agree that separating the filter logic from the controllers is a good thing.
I have a few questions for the code posted above: 1) Would the $routes array mean that if I had 100 routes that I wanted to use a certain before filter but I did not want in the global score mean that I'd have to to set that filter for each individual one? For example: PHP Code: public $routes = [ 2) Would the $routes array follow the inputted url or the routed url? 3) Would it be simpler if we reversed the array and were able to create multiple routes under a group of filters? I would think it's much easier to copy a group of routes into a filter than add a filter to a bunch of routes.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
|
Welcome Guest, Not a member yet? Register Sign In |