From 32c5e00bf496169f52c72cac4c215d0c6f75e376 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 27 Jun 2016 12:31:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96Route=E7=B1=BB=E7=9A=84parseU?= =?UTF-8?q?rl=E6=96=B9=E6=B3=95=20=E5=8F=96=E6=B6=88url=5Fparse=5Ftype?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- convention.php | 2 -- library/think/App.php | 2 +- library/think/Route.php | 8 +++----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/convention.php b/convention.php index a95b6b50..eca9e883 100644 --- a/convention.php +++ b/convention.php @@ -93,8 +93,6 @@ return [ 'url_controller_layer' => 'controller', // 表单请求类型伪装变量 'var_method' => '_method', - // URL解析方式 module controller class namespace - 'url_parse_type' => 'module', // +---------------------------------------------------------------------- // | 模板引擎设置 diff --git a/library/think/App.php b/library/think/App.php index 374df826..266475f2 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -468,7 +468,7 @@ class App } if (false === $result) { // 路由无效 解析模块/控制器/操作/参数... 支持控制器自动搜索 - $result = Route::parseUrl($path, $depr, $config['controller_auto_search'], $config['url_param_type'], $config['url_parse_type']); + $result = Route::parseUrl($path, $depr, $config['controller_auto_search']); } return $result; } diff --git a/library/think/Route.php b/library/think/Route.php index 69c02bc1..088dcdb7 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -931,8 +931,8 @@ class Route * 检测路由规则 * @access private * @param string $rule 路由规则 - * @param string $url URL地址 * @param string $route 路由地址 + * @param string $url URL地址 * @param array $pattern 变量规则 * @param array $option 路由参数 * @return array|false @@ -1002,11 +1002,9 @@ class Route * @param string $url URL地址 * @param string $depr URL分隔符 * @param bool $autoSearch 是否自动深度搜索控制器 - * @param integer $paramType URL参数解析方式 0 名称解析 1 顺序解析 - * @param string $type 路由类型 * @return array */ - public static function parseUrl($url, $depr = '/', $autoSearch = false, $paramType = 0, $type = 'module') + public static function parseUrl($url, $depr = '/', $autoSearch = false) { if (isset(self::$bind['module'])) { // 如果有模块/控制器绑定 @@ -1047,7 +1045,7 @@ class Route // 封装路由 $route = [$module, $controller, $action]; } - return ['type' => $type, $type => $route]; + return ['type' => 'module', 'module' => $route]; } /**