/**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new ItemTemplateItem();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['ItemTemplateItem'])) {
         $model->attributes = $_POST['ItemTemplateItem'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
Esempio n. 2
0
 public function actionSaveSub($id)
 {
     $model = $this->loadModel($id);
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['ItemTemplateItem'])) {
         $submodel = new ItemTemplateItem();
         $submodel->attributes = $_POST['ItemTemplateItem'];
         if ($submodel->save()) {
             $this->redirect(array('update', 'id' => $model->id));
         }
     }
     $this->redirect(array('update', 'id' => $model->id));
 }