summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-04-09 21:57:32 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-04-10 16:25:44 +0200
commitfc8004d335782374c5a78ed652e3b88263dd1875 (patch)
treefbc3f19c856e2ede1d1d95e8e73b23e5ea232686 /lib/private
parent2257ae987f773e5f59054b4b89baf8ddcf78d485 (diff)
downloadnextcloud-server-fc8004d335782374c5a78ed652e3b88263dd1875.tar.gz
nextcloud-server-fc8004d335782374c5a78ed652e3b88263dd1875.zip
add requirements to routing
Conflicts: tests/lib/appframework/routing/RoutingTest.php
Diffstat (limited to 'lib/private')
-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 53ab11bf2f5..19acc0c27f0 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']);
+ }
}
}