summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBernhard Posselt <Raydiation@users.noreply.github.com>2014-09-09 23:40:46 +0200
committerBernhard Posselt <Raydiation@users.noreply.github.com>2014-09-09 23:40:46 +0200
commitba698a4942ba3db13069c73aba5eb610c74604f9 (patch)
tree7564831f1272b402dbcc3d9f335d6b2c4d2950ca /lib
parentc3d90b96c8ec4bcf96e28c6ccdb194494888cc61 (diff)
parentcb5416b798a9fde6d4826ad82b1f846b88a1ffcd (diff)
downloadnextcloud-server-ba698a4942ba3db13069c73aba5eb610c74604f9.tar.gz
nextcloud-server-ba698a4942ba3db13069c73aba5eb610c74604f9.zip
Merge pull request #10972 from ppaysant/routes-defaults
Allow default values for route parameters.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/appframework/routing/routeconfig.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/appframework/routing/routeconfig.php b/lib/private/appframework/routing/routeconfig.php
index 5b4d411a355..91687b9c83c 100644
--- a/lib/private/appframework/routing/routeconfig.php
+++ b/lib/private/appframework/routing/routeconfig.php
@@ -93,6 +93,12 @@ class RouteConfig {
if(array_key_exists('requirements', $simpleRoute)) {
$router->requirements($simpleRoute['requirements']);
}
+
+ // optionally register defaults for route. This is used to
+ // tell the route parser how url parameters should be default valued
+ if(array_key_exists('defaults', $simpleRoute)) {
+ $router->defaults($simpleRoute['defaults']);
+ }
}
}