在控制器里边判断用户的请求类型是get还是post $request = \Yii::$app->request; $requestType = $request->isGet;  $requestType = $request->isPost; 判断用户请求的ip地址 $userip = $request->userIP;
在控制器里边判断用户的请求类型是get还是post
$request = \Yii::$app->request;
$requestType = $request->isGet;
 $requestType = $request->isPost;
判断用户请求的ip地址
$userip = $request->userIP;

lovermeng/yii2