mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Fixes and development
- `$parameter` argument in `findUrl` method now supports both string, array and null value to avoid confusion. - Using return value in callbacks now displays value (issue: #257)
This commit is contained in:
@@ -76,9 +76,7 @@ abstract class Route implements IRoute
|
||||
if (is_callable($callback) === true) {
|
||||
|
||||
/* When the callback is a function */
|
||||
call_user_func_array($callback, $this->getParameters());
|
||||
|
||||
return;
|
||||
return call_user_func_array($callback, $this->getParameters());
|
||||
|
||||
}
|
||||
|
||||
@@ -106,7 +104,7 @@ abstract class Route implements IRoute
|
||||
});
|
||||
}
|
||||
|
||||
call_user_func_array([$class, $method], $parameters);
|
||||
return call_user_func_array([$class, $method], $parameters);
|
||||
}
|
||||
|
||||
protected function parseParameters($route, $url, $parameterRegex = null)
|
||||
|
||||
Reference in New Issue
Block a user