mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进控制器自动搜索的后缀支持
This commit is contained in:
@@ -697,11 +697,12 @@ class Route
|
|||||||
$module = APP_MULTI_MODULE ? array_shift($path) : null;
|
$module = APP_MULTI_MODULE ? array_shift($path) : null;
|
||||||
if ($autoSearch) {
|
if ($autoSearch) {
|
||||||
// 自动搜索控制器
|
// 自动搜索控制器
|
||||||
$dir = APP_PATH . ($module ? $module . DS : '') . CONTROLLER_LAYER;
|
$dir = APP_PATH . ($module ? $module . DS : '') . CONTROLLER_LAYER;
|
||||||
$item = [];
|
$suffix = CLASS_APPEND_SUFFIX || Config::get('use_controller_suffix') ? ucfirst(CONTROLLER_LAYER) : '';
|
||||||
|
$item = [];
|
||||||
foreach ($path as $val) {
|
foreach ($path as $val) {
|
||||||
$item[] = array_shift($path);
|
$item[] = array_shift($path);
|
||||||
if (is_file($dir . DS . $val . EXT)) {
|
if (is_file($dir . DS . $val . $suffix . EXT)) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
$dir .= DS . $val;
|
$dir .= DS . $val;
|
||||||
|
|||||||
Reference in New Issue
Block a user