request->isPost)" to determine. If the condition is true, it was submitted by post."/> request->isPost)" to determine. If the condition is true, it was submitted by post.">

Home  >  Article  >  PHP Framework  >  yii2 determines whether it is a post submission form

yii2 determines whether it is a post submission form

angryTom
angryTomOriginal
2019-11-06 15:49:152885browse

yii2 determines whether it is a post submission form

yii2 Determine whether it is a post submission form

Determine post submission

if(Yii::$app->request->isPost){
    return true;  
}else{
    return false;  
}

Judge get submission

if(Yii::$app->request->isGet){
    return true;
}else{
    return false;  
}

Recommended: "YII Tutorial"

The above is the detailed content of yii2 determines whether it is a post submission form. 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