request->post($key,$default)" statement to get the post parameters."/> request->post($key,$default)" statement to get the post parameters.">
Home > Article > PHP Framework > How to get post parameters in Yii?
yii method of obtaining Post parameters:
Yii::$app->request->post($key, $default)
The first parameter ($key) is the key requested by the user's post. The first parameter is optional,
The second parameter ($default) is the default value, and the second parameter is optional; if you do not fill in the parameter, you will get an array of post data.
Yii::$app->request->bodyParams: The result is an array, which is equal to Yii::$app->request->post().
Judge user request:
Yii::$app->request->isGet; Yii::$app->request->isPost;
Related tutorial recommendations: yii framework
The above is the detailed content of How to get post parameters in Yii?. For more information, please follow other related articles on the PHP Chinese website!