转自:https://blog.csdn.net/foreverlikui/article/details/88974590
之前使用3.2版本时,经常会使用到
if(IS_POST){
}else{
}
在thinkphp5.1中,废除了IS_POST。
thinkphp5.1中,我们可以这样用,
控制器中引入
use think\facade\Request;
public function index()
{
if(Request::isPost()){
//这样判断
} else {
}
}
更多精彩内容:各种AI课程、技能课程、黑科技软件、网站小程序源码、副业小项目、PPT模板等精品素材、电商课程、推广引流课程等,尽在 天边资源网 。