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

How does yii determine whether it is an ajax submission?

王林
王林Original
2020-02-17 15:19:432449browse

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         
    } 
}

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!

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