Controller Filters - Input needed |
(07-07-2016, 09:39 PM)kilishan Wrote: It does seem be very similar to what you're asking for. That's the million dollar question ![]() Is it necessary? No. In essence, you can just extend your base controller and add all the functionality in there. But again, neither is a validation library, query builder, cache driver as you can code them on your own. At the end of the day, I'm just a developer trying to find the easiest tool to use to get a project going quickly and in a clean and organized manner. The first time I ran into filters in Rails, I thought it was great and it cleaned up my code compared to my very early CI days. Then I saw php middleware and thought it was a massive upgrade in terms of ease of use, readability, and most importantly maintainability. When building my projects with my devs, one of the criteria I use to decide design philosophies is how much code needs to be written to get it going, and how much code needs to be rewritten to change some functionality. With controller filters, I may have to change 50+ controllers to add or remove a filter, and that's without worrying about :before, :after. With a single filters file, I may have to change 1 line.
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 |