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

One feature that I've been thinking about for CI4 is some form of middleware/filter. This has become a popular way of doing things, and can be quite handy.

In some frameworks, like Laravel, the middleware is assigned at the route level, where you say that X middleware runs before or after that route. This works great for frameworks that require all routes to be defined in a routes file.

Other frameworks, like Rails, have controller filters where you can define "filters", or middleware, at the controller level, instead. To me this makes more sense for the CodeIgniter we have, where we do not force people to define every route, and lots of routes are simply determined based on auto-routing to the controller based on the URL.

Both methods have their pros and cons. I had written the Rails way up as a new feature, when albertleao brought up a very good point about the manageability in the long run of this type of a system.

So, I'm looking for input, especially from those of you who have used multiple frameworks in the past. What do you feel are pros and cons to these systems? What other ways have you seen this done?
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 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