tp5 空模塊跳轉

thinkphp\library\think\route\dispatch\Module.php

// 模塊初始化
            if ($module && $available) {
                // 初始化模塊
                $this->app['request']->module($module);
                $this->app->init($module);


                // 加載當前模塊語言包
                $this->app['lang']->load($this->app->getAppPath() . $module . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR . $this->app['request']->langset() . '.php');


                // 模塊請求緩存檢查
                $this->app['request']->cache(
                    $this->app->config('app.request_cache'),
                    $this->app->config('app.request_cache_expire'),
                    $this->app->config('app.request_cache_except')
                );
            } else {
                

                header('Location:/404.html');die;//在此進行跳轉

                throw new HttpException(404, 'module not exists:' . $module);
            }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章