From 8b17c70e3c27e702c779817269a174dd95df298d Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 7 Jan 2016 09:33:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BUrl=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Url.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/library/think/Url.php b/library/think/Url.php index 6997618b..9172aa9f 100644 --- a/library/think/Url.php +++ b/library/think/Url.php @@ -46,13 +46,17 @@ class Url $url = trim($url, $depr); $path = explode($depr, $url); $var = []; - if (!defined('BIND_ACTION')) { + $bind = Route::bind('module'); + if($bind){ + list($var['module'],$var['controller'],$var['action']) = explode('/',$bind); + } + if (empty($var['action'])) { $var['action'] = !empty($path) ? array_pop($path) : ACTION_NAME; } - if (!defined('BIND_CONTROLLER')) { + if (empty($var['controller']) { $var['controller'] = !empty($path) ? array_pop($path) : CONTROLLER_NAME; } - if (APP_MULTI_MODULE && !defined('BIND_MODULE')) { + if (APP_MULTI_MODULE && empty($var['module'])) { if (!empty($path)) { $var['module'] = array_pop($path); } elseif (MODULE_NAME) {