OKyJIucT
10/2/2016 - 9:30 AM

ajax response

ajax response

public function actionSimple() {
    if (Yii::$app->request->isAjax) {
        Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
 
 
        $res = array(
            'body'    => date('Y-m-d H:i:s'),
            'success' => true,
        );
 
        return $res;
    }
}