From 80e87d1d795efc6dab3d4bac451f3bcc1dce731a Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 23 May 2016 10:10:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=90=9C=E7=B4=A2=E7=9A=84=E5=90=8E=E7=BC=80?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 609b4ae6..73bd8bff 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -697,11 +697,12 @@ class Route $module = APP_MULTI_MODULE ? array_shift($path) : null; if ($autoSearch) { // 自动搜索控制器 - $dir = APP_PATH . ($module ? $module . DS : '') . CONTROLLER_LAYER; - $item = []; + $dir = APP_PATH . ($module ? $module . DS : '') . CONTROLLER_LAYER; + $suffix = CLASS_APPEND_SUFFIX || Config::get('use_controller_suffix') ? ucfirst(CONTROLLER_LAYER) : ''; + $item = []; foreach ($path as $val) { $item[] = array_shift($path); - if (is_file($dir . DS . $val . EXT)) { + if (is_file($dir . DS . $val . $suffix . EXT)) { break; } else { $dir .= DS . $val;