aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-04-10 16:23:01 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-04-10 16:23:01 +0200
commit26a89e369eefedd329335624924ec2b185273c79 (patch)
treef159a2a0ef95c6a9bb24358c16306612f8902772 /lib
parentecd74d363041cd447e44d31a72b36ae55c11902f (diff)
parent70c88027db5c5d586d689d310572f8f34d10b285 (diff)
downloadnextcloud-server-26a89e369eefedd329335624924ec2b185273c79.tar.gz
nextcloud-server-26a89e369eefedd329335624924ec2b185273c79.zip
Merge pull request #8137 from owncloud/routeing-requirements
add requirements to routing
Diffstat (limited to 'lib')
-rw-r--r--lib/private/appframework/routing/routeconfig.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/appframework/routing/routeconfig.php b/lib/private/appframework/routing/routeconfig.php
index 35bee75cc4d..a3bbde6af53 100644
--- a/lib/private/appframework/routing/routeconfig.php
+++ b/lib/private/appframework/routing/routeconfig.php
@@ -84,7 +84,15 @@ class RouteConfig {
// register the route
$handler = new RouteActionHandler($this->container, $controllerName, $actionName);
- $this->router->create($this->appName.'.'.$controller.'.'.$action, $url)->method($verb)->action($handler);
+ $router = $this->router->create($this->appName.'.'.$controller.'.'.$action, $url)
+ ->method($verb)
+ ->action($handler);
+
+ // optionally register requirements for route. This is used to
+ // tell the route parser how url parameters should be matched
+ if(array_key_exists('requirements', $simpleRoute)) {
+ $router->requirements($simpleRoute['requirements']);
+ }
}
}