[BUGFIX] Fixed minor errors with optional parameter when using getRoute().

This commit is contained in:
Simon Sessingø
2016-01-17 04:56:29 +01:00
parent 27d24758b1
commit 4dd0739df9
2 changed files with 14 additions and 2 deletions
+5 -1
View File
@@ -376,7 +376,11 @@ abstract class RouterEntry {
throw new RouterException(sprintf('Method %s does not exist in class %s', $method, $className), 404);
}
call_user_func_array(array($class, $method), $this->getParameters());
$parameters = array_filter($this->getParameters(), function($var){
return !is_null($var);
});
call_user_func_array(array($class, $method), $parameters);
return $class;
}