Home > PHP Framework > YII > How to get post parameters in Yii?

How to get post parameters in Yii?

Release: 2020-03-11 13:19:31
Original
3080 people have browsed it

How to get post parameters in Yii?

yii method of obtaining Post parameters:

Yii::$app->request->post($key, $default)
Copy after login

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;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template