summaryrefslogtreecommitdiffstats
path: root/lib/private/appframework
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-04-09 21:57:32 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-04-09 21:57:32 +0200
commit70c88027db5c5d586d689d310572f8f34d10b285 (patch)
treec0604f8db325427cc4957a729f34e0327b9c903a /lib/private/appframework
parent5b8c7a01e90a03687a209ed5f3bd419b095f4f66 (diff)
downloadnextcloud-server-70c88027db5c5d586d689d310572f8f34d10b285.tar.gz
nextcloud-server-70c88027db5c5d586d689d310572f8f34d10b285.zip
add requirements to routing
Diffstat (limited to 'lib/private/appframework')
-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']);
+ }
}
}