本篇文章给大家带来的内容是关于thinkphp5的get和post数据封装的方法介绍(代码),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。
thinkphp5的get和post数据封装
一、view(html页面获取数据)
二、控制器
一、view(html页面获取数据)
搜索
二、控制器
1、正常情况下我们是这样操作的public function index(){
$where['status'] =input('get.status');
$where['atype'] =input('get.atype');
$where['nireid'] =input('get.nireid');
$this->assign('where',$where);
$this->assign(UserExtractModel::systemPage($where));
return $this->fetch();
}
2、其实我们可以这样做public function index(){
$where = self::getMore([
['status',''],
['atype',''],
['nireid',''],
],$this->request);
$this->assign('where',$where);
$this->as