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?

How to get post parameters in Yii?

尚
Original
2020-03-11 13:19:312969browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn