From e3c2f421227341f06bfc661887141f9fcb5d1cfd Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 17 Feb 2016 22:15:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0url=5Fcontroller=5Fconvert?= =?UTF-8?q?=E5=92=8Curl=5Faction=5Fconvert=20=E7=94=A8=E4=BA=8E=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=98=AF=E5=90=A6=E8=87=AA=E5=8A=A8=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?URL=E9=87=8C=E9=9D=A2=E7=9A=84=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E5=92=8C=E6=93=8D=E4=BD=9C=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/App.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/think/App.php b/library/think/App.php index 82ae8468..8dabc2f9 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -214,9 +214,12 @@ class App } // 获取控制器名 - define('CONTROLLER_NAME', strtolower(strip_tags($result[1] ?: Config::get('default_controller')))); + $controllerName = strip_tags($result[1] ?: Config::get('default_controller')); + define('CONTROLLER_NAME', $config['url_controller_convert'] ? strtolower($controllerName) : $controllerName); + // 获取操作名 - define('ACTION_NAME', strtolower(strip_tags($result[2] ?: Config::get('default_action')))); + $actionName = strip_tags($result[2] ?: Config::get('default_action')); + define('ACTION_NAME', $config['url_action_convert'] ? strtolower($actionName) : $actionName); // 执行操作 if (!preg_match('/^[A-Za-z](\/|\.|\w)*$/', CONTROLLER_NAME)) {