改进Request类的dispatch方法

This commit is contained in:
thinkphp
2016-06-24 17:30:47 +08:00
parent 1e21d9af34
commit 73f1ae289d

View File

@@ -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;
}