This commit is contained in:
thinkphp
2016-06-07 22:26:26 +08:00

View File

@@ -272,13 +272,14 @@ class App
Hook::listen('module_init', $request); Hook::listen('module_init', $request);
try { try {
$instance = Loader::controller($controller, $config['url_controller_layer'], $config['use_controller_suffix'], $config['empty_controller']);
// 获取当前操作名 // 获取当前操作名
$action = $actionName . $config['action_suffix']; $action = $actionName . $config['action_suffix'];
if (!preg_match('/^[A-Za-z](\w)*$/', $action)) { if (!preg_match('/^[A-Za-z](\w)*$/', $action)) {
// 非法操作 // 非法操作
throw new \ReflectionException('illegal action name :' . $actionName); throw new \ReflectionException('illegal action name :' . $actionName);
} }
$instance = Loader::controller($controller, $config['url_controller_layer'], $config['use_controller_suffix'], $config['empty_controller']);
// 执行操作方法 // 执行操作方法
$call = [$instance, $action]; $call = [$instance, $action];