You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because there have been multiple issues and/or pull requests about route groups, namespaces and constraints, here a central issue to the discuss the requirements for such a feature.
I think nested function would be a nice way to group routes.
$router->group(function($method, $route, $target, $name = null) {
// this method is called for all routes in a groupreturn [$method, '/admin' . $route, $target, $name];
}, function($router) {
#=> matches /admin/index$router->map('GET', '/index', 'some_action');
});
I think it would be cool to add support for this, but not super sold on it yet as it's also a fairly trivial thing to do yourself (as you did already, I believe).
What other group types will we allow besides path prefixes. Subdomain? HTTP methods? If we're just supporting path prefixes, do we need the configuration array at all?
From first sight, I do prefer the first proposed syntax over the second one.
Because there have been multiple issues and/or pull requests about route groups, namespaces and constraints, here a central issue to the discuss the requirements for such a feature.
I think nested function would be a nice way to group routes.
For example:
Or more generic with some sort of middleware:
But more suggestions are welcome.
cc: #52 #83 #149
The text was updated successfully, but these errors were encountered: