diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-11-24 16:32:54 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-11-24 16:32:54 +0100 |
commit | ddacd7f9007d8e79415ae1e850588f92882b8329 (patch) | |
tree | ef0ee77f9a2936208fc523ec1bcb834cb35df0b5 /lib/private/appframework | |
parent | 168fce0b182e69d1364e4432178a8131961d6583 (diff) | |
parent | 4e90c44301cdacc85f31259bff887b035a1b9716 (diff) | |
download | nextcloud-server-ddacd7f9007d8e79415ae1e850588f92882b8329.tar.gz nextcloud-server-ddacd7f9007d8e79415ae1e850588f92882b8329.zip |
Merge pull request #12294 from owncloud/route-postfix
Add route postfix to allow url versioning when only the http method changed
Diffstat (limited to 'lib/private/appframework')
-rw-r--r-- | lib/private/appframework/routing/routeconfig.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/appframework/routing/routeconfig.php b/lib/private/appframework/routing/routeconfig.php index 91687b9c83c..9816b062b8d 100644 --- a/lib/private/appframework/routing/routeconfig.php +++ b/lib/private/appframework/routing/routeconfig.php @@ -69,6 +69,12 @@ class RouteConfig { $simpleRoutes = isset($routes['routes']) ? $routes['routes'] : array(); foreach ($simpleRoutes as $simpleRoute) { $name = $simpleRoute['name']; + $postfix = ''; + + if (isset($simpleRoute['postfix'])) { + $postfix = $simpleRoute['postfix']; + } + $url = $simpleRoute['url']; $verb = isset($simpleRoute['verb']) ? strtoupper($simpleRoute['verb']) : 'GET'; @@ -84,7 +90,7 @@ class RouteConfig { // register the route $handler = new RouteActionHandler($this->container, $controllerName, $actionName); - $router = $this->router->create($this->appName.'.'.$controller.'.'.$action, $url) + $router = $this->router->create($this->appName.'.'.$controller.'.'.$action . $postfix, $url) ->method($verb) ->action($handler); |