Ejemplo n.º 1
0
 public function actionValidBeritaAcara()
 {
     # code...
     $model = new Berita();
     if (Yii::$app->request->isAjax && $model->load($_POST)) {
         /* not usage
            if checkbox equal false then scenario validation false
                else checkbox equal true then scenario validation true
            */
         // if($_POST['Berita']['alluser'] == 0){
         //     $model->scenario = 'false';
         // }else{
         //     $model->scenario = 'true';
         // }
         Yii::$app->response->format = 'json';
         return ActiveForm::validate($model);
     }
 }