public function actionAjax()
{
    if(isset(Yii::$app->request->post('test'))){
        $test = "Ajax Worked!";
        // do your query stuff here
    }else{
        $test = "Ajax failed";
        // do your query stuff here
    }

    // return Json    
    return \yii\helpers\Json::encode($test);
}

 

相关文章:

  • 2022-12-23
  • 2022-02-14
  • 2021-08-10
  • 2022-12-23
  • 2021-09-21
  • 2021-10-23
  • 2022-02-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2021-12-06
  • 2021-06-09
  • 2022-12-23
相关资源
相似解决方案