优化Route类的变量传值 统一使用Request类的param方法获取

This commit is contained in:
thinkphp
2016-09-09 18:25:16 +08:00
parent 96f5428a5e
commit f52a7bf978
2 changed files with 9 additions and 10 deletions

View File

@@ -135,15 +135,15 @@ class App
break;
case 'controller':
// 执行控制器操作
$data = Loader::action($dispatch['controller'], $dispatch['params']);
$data = Loader::action($dispatch['controller']);
break;
case 'method':
// 执行回调方法
$data = self::invokeMethod($dispatch['method'], $dispatch['params']);
$data = self::invokeMethod($dispatch['method']);
break;
case 'function':
// 执行闭包
$data = self::invokeFunction($dispatch['function'], $dispatch['params']);
$data = self::invokeFunction($dispatch['function']);
break;
case 'response':
$data = $dispatch['response'];
@@ -181,12 +181,11 @@ class App
* @access public
* @param array|string $dispatch 调度信息
* @param string $type 调度类型
* @param array $params 参数
* @return void
*/
public static function dispatch($dispatch, $type = 'module', $params = [])
public static function dispatch($dispatch, $type = 'module')
{
self::$dispatch = ['type' => $type, $type => $dispatch, 'params' => $params];
self::$dispatch = ['type' => $type, $type => $dispatch];
}
/**