/**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new AccTemplateItem();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     return $this->render('create', array('model' => $model));
 }
 public function actionSaveSub($id)
 {
     $model = $this->loadModel($id);
     $submodel = new AccTemplateItem();
     if ($submodel->load(Yii::$app->request->post())) {
         if ($submodel->save()) {
             $this->redirect(array('update', 'id' => $model->id));
         }
     }
     $this->redirect(array('view', 'id' => $model->id));
 }