We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d6c090 commit a7bd063Copy full SHA for a7bd063
Core/Router.php
@@ -117,11 +117,11 @@ public function dispatch($url)
117
$action = $this->params['action'];
118
$action = $this->convertToCamelCase($action);
119
120
- if (is_callable([$controller_object, $action])) {
+ if (preg_match('/action$/i', $action) == 0) {
121
$controller_object->$action();
122
123
} else {
124
- throw new \Exception("Method $action (in controller $controller) not found");
+ throw new \Exception("Method $action in controller $controller cannot be called directly - remove the Action suffix to call this method");
125
}
126
127
throw new \Exception("Controller class $controller not found");
0 commit comments