Beispiel #1
0
 public function actionNseditor()
 {
     $model = new Nstable();
     if (Yii::$app->request->isAjax) {
         echo 'Ajax';
     }
     if (Yii::$app->request->isPjax) {
         echo 'Pjax';
     }
     if (Yii::$app->request->isPost) {
         echo 'Post';
         $model = new Nstable();
         $model->load(Yii::$app->request->post());
         if ($model->validate()) {
             $model->makeRoot();
         }
         $model = new Nstable();
         // reset model
     }
     return $this->render('nseditor', ['model' => $model]);
 }