File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 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 {
113113                $ par [] = array_pop ($ action );
114114                continue ;
115115            }
116-             $ classname  = '\\Controller \\'  . strtolower (implode ('\\' , $ action )) . '\\'  . $ this  ->method  . $ v ;
116+             $ classname  = '\\Controller \\'  . (empty ($ action ) ? ''  : strtolower (implode ('\\' , $ action )) . '\\' ) .
117+                 $ this  ->method  . $ v ;
117118            $ class_exists  = class_exists ($ classname , false );
118119            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 ' ;
121122                if  (file_exists ($ file_name )) {
122123                    require_once  $ file_name ;
123124                    $ class_exists  = class_exists ($ classname , false );
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments