Controller Filters - Input needed |
@arma7x - I get what you're saying about tieing to a controller/method, I do. I don't think it's the most practical method though. I keep hearing people talk about having hundreds or thousands of controllers. That would be a horror trying to map up filters to. And by attaching to the uri, you can easily wild-card entire groups of routes to cut down on the maintenance.
@albertleao - Not at all! That's where wild-carding comes in. If all of those pages are behind an 'admin' uri, then you can specify it like: Code: 'adminAuth' => ['before' => ['admin/*']] in the $filters array. That would apply to any uri that starts with **admin**. Or if it's you have a small section of your site or two that is easily group-able you could do it as an exclusion to the global setting, like: Code: public $globals = [ Does that make sense? |
Welcome Guest, Not a member yet? Register Sign In |