Modify router to accept variables and do test

This commit is contained in:
2017-08-31 10:21:55 +07:00
parent d51baaf2c2
commit 6666d674a6
2 changed files with 14 additions and 11 deletions

View File

@@ -65,7 +65,11 @@ class Router
$action = $this->convertToCamelCaps($action);
if (is_callable([$object, $action])) {
$object->$action();
if (array_key_exists('id', $this->params)) {
$var = $this->params['id'];
return $object->$action($var);
}
return $object->$action();
}
}
}