File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,20 +45,19 @@ class Controller extends Dispatch
4545 public function init (App $ app )
4646 {
4747 $ this ->app = $ app ;
48- $ this ->parseDispatch ();
48+ $ this ->parseDispatch ($ this -> dispatch );
4949 $ this ->doRouteAfter ();
5050 }
5151
52- protected function parseDispatch ()
52+ protected function parseDispatch ($ path )
5353 {
54- $ path = $ this ->dispatch ;
5554 if (is_string ($ path )) {
5655 $ path = explode ('/ ' , $ path );
5756 }
5857
5958 $ action = !empty ($ path ) ? array_pop ($ path ) : $ this ->rule ->config ('default_action ' );
6059 $ controller = !empty ($ path ) ? array_pop ($ path ) : $ this ->rule ->config ('default_controller ' );
61- $ layer = !empty ($ path ) ? implode ('\\ ' , $ path ) : '' ;
60+ $ layer = !empty ($ path ) ? implode ('/ ' , $ path ) : '' ;
6261
6362 if ($ layer && !empty ($ this ->option ['auto_middleware ' ])) {
6463 // 自动为顶层layer注册中间件
You can’t perform that action at this time.
0 commit comments