改进Request类

This commit is contained in:
thinkphp
2016-05-09 23:19:41 +08:00
parent 96a32debc2
commit c305b11d1b
4 changed files with 203 additions and 73 deletions

View File

@@ -22,6 +22,7 @@ use think\Input;
use think\Lang;
use think\Loader;
use think\Log;
use think\Request;
use think\Route;
use think\Session;
use think\Url;
@@ -358,3 +359,14 @@ function route($rule = '', $route = [], $type = '*', $option = [], $pattern = []
{
Route::register($rule, $route, $type, $option, $pattern);
}
/**
* 获取Request参数
* @param string $name 方法
* @param mixed $param 参数
* @return mixed
*/
function request($name, $param = '')
{
return Request::instance()->$name($param);
}