File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -113,11 +113,12 @@ public function getController(\Swoole\Http\Response $response): Controller {
113
113
$ par [] = array_pop ($ action );
114
114
continue ;
115
115
}
116
- $ classname = '\\Controller \\' . strtolower (implode ('\\' , $ action )) . '\\' . $ this ->method . $ v ;
116
+ $ classname = '\\Controller \\' . (empty ($ action ) ? '' : strtolower (implode ('\\' , $ action )) . '\\' ) .
117
+ $ this ->method . $ v ;
117
118
$ class_exists = class_exists ($ classname , false );
118
119
if (! $ class_exists ) {
119
- $ file_name = Environment::getDir ()->controller . strtolower ( implode ( ' / ' , $ action )) . ' / ' .
120
- $ this ->method . $ v . '.php ' ;
120
+ $ file_name = Environment::getDir ()->controller .
121
+ ( empty ( $ action ) ? '' : strtolower ( implode ( ' / ' , $ action )) . ' / ' ) . $ this ->method . $ v . '.php ' ;
121
122
if (file_exists ($ file_name )) {
122
123
require_once $ file_name ;
123
124
$ class_exists = class_exists ($ classname , false );
You can’t perform that action at this time.
0 commit comments