From 73f1ae289d6538b86c903c841ce22d5c30bb8fc4 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 24 Jun 2016 17:30:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=B1=BB=E7=9A=84disp?= =?UTF-8?q?atch=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index 39981afe..4b83c3b1 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -1296,13 +1296,16 @@ class Request /** * 获取当前请求的调度信息 * @access public - * @param array $dispatch 调度信息 + * @param array|string $dispatch 调度信息 + * @param string $type 调度类型 * @return array */ - public function dispatch($dispatch = []) + public function dispatch($dispatch = null, $type = null, $params = []) { - if (!empty($dispatch)) { - $this->dispatch = $dispatch; + if (!is_null($dispatch)) { + $this->dispatch = is_array($dispatch) ? + $dispatch : + ['type' => $type, $type => $dispatch, 'params' => $param]; } return $this->dispatch; }