api_router - allow parameters as final path argument
This commit is contained in:
parent
8e50fecccc
commit
47001c3303
@ -12,8 +12,16 @@ class Api_router {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function find($path) {
|
static function find($path) {
|
||||||
if(array_key_exists($path,self::$routes))
|
if (array_key_exists($path,self::$routes)) {
|
||||||
return self::$routes[$path];
|
return self::$routes[$path];
|
||||||
|
}
|
||||||
|
|
||||||
|
$with_params = dirname($path) . '/[id]';
|
||||||
|
|
||||||
|
if (array_key_exists($with_params,self::$routes)) {
|
||||||
|
return self::$routes[$with_params];
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user