Skip to content

Commit b50f9dc

Browse files
committed
Merge pull request #90 from blindsamson/multiple-paths
Adding in support for multiple routes definitions through an array
2 parents 7a73525 + 98f9a6f commit b50f9dc

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

library/Respect/Rest/Router.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ public function __call($method, $args)
145145

146146
list ($path, $routeTarget) = $args;
147147

148+
// Support multiple route definitions as array of paths
149+
if (is_array($path)) {
150+
$lastPath = array_pop($path);
151+
foreach ($path as $p)
152+
$this->$method($p, $routeTarget);
153+
return $this->$method($lastPath, $routeTarget);
154+
}
155+
148156
//closures, func names, callbacks
149157
if (is_callable($routeTarget)) {
150158

0 commit comments

Comments
 (0)