public function actionDemo(){ $req=\YII::$app->request; echo $req->get('id');//以get方式接值 echo $req->post("name",3333); //以post方式接值 if($req->isPost){//判断接值方式为post返回true echo 'this is post method'; } if($req->isGet){//判断接值方式为get返回true echo 'this is get method'; } echo $req->userIp;//输出当前IP }
yii接值方式判断以及获取当前用户ip
最新推荐文章于 2024-11-06 23:12:49 发布