Welcome Guest, Not a member yet? Register   Sign In
Controller Filters - Input needed
#11

(This post was last modified: 07-08-2016, 05:50 PM by prezire.)

Subjectively, my idea about middlewares and/or filters is similar to CI3's core hooks. The only difference is that hooks are core level broadcasts that you can tap into. CI3's everything-singleton had a nice effect on auto-loaded libraries, which could act similarly as middlewares.

Meanwhile, one thing I noticed in Laravel is its ability for developers to either use routes only and/or routes plus controllers approach. CI3's routes on the other hand is a good thing because it's not a requirement. In short, I'd vote for middlewares NOT to be available in routes because too much convenience approach would put a lot of stress and confusion to the framework's structure. Middlewares should be explicitly implemented on areas that have proper structures like classes. Even CI3 Form Validation itself needed to be discussed thoroughly whether it should be placed in controllers (based on documentation samples) or on models. It's a good thing CI implemented it as a Library so it can be used anywhere, explicitly.

I keep looking back at CI3 in hopes CI4 can still be used similarly while adapting to the new PHP7 features, without adding too much conventions that would complicate projects. Know the cons about too much convenience and implicit implementations by following Laravel's 5.2 Auth implementation (controllers, models, middlewares) https://laravel.com/docs/5.2/authentication and see if you can grasp the entire flow within 3 to 5 minutes.
Long live CodeIgniter!
Reply


Messages In This Thread
Controller Filters - Input needed - by kilishan - 07-07-2016, 08:39 PM
RE: Controller Filters - Input needed - by arma7x - 07-10-2016, 06:46 AM
RE: Controller Filters - Input needed - by arma7x - 07-07-2016, 09:14 PM
RE: Controller Filters - Input needed - by prezire - 07-08-2016, 05:14 PM
RE: Controller Filters - Input needed - by arma7x - 07-10-2016, 11:42 PM
RE: Controller Filters - Input needed - by arma7x - 07-12-2016, 01:55 AM
RE: Controller Filters - Input needed - by arma7x - 07-13-2016, 12:23 AM
RE: Controller Filters - Input needed - by arma7x - 07-14-2016, 12:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB