Home > PHP Framework > YII > How does yii determine whether it is an ajax submission?

How does yii determine whether it is an ajax submission?

王林
Release: 2020-02-17 15:19:43
Original
2429 people have browsed it

How does yii determine whether it is an ajax submission?

The method to determine whether it is an ajax submission is as follows:

(Related tutorials recommended: yii framework)

public function actionDelete() {         
    if (Yii::$app->request >isAjax) {             
        // request is ajax request        
    }         
    else {            
     // not ajax request             
    // for example redirect         
    } 
}
Copy after login

More To learn programming-related content, you can follow the Programming Tutorial column on the PHP Chinese website!

The above is the detailed content of How does yii determine whether it is an ajax submission?. 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