Exemplo n.º 1
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Almacenes();
     // Uncomment the following line if AJAX validation is needed
     //$this->performAjaxValidation($model);
     if (isset($_POST['Almacenes'])) {
         $model->attributes = $_POST['Almacenes'];
         //print_r($_POST['Almacenes']);
         //Yii:app()->end();
         if ($model->save()) {
             $model->refresh();
             yii::app()->user->setFlash('success', 'Se grabo el Almacen');
             $this->render('update', array('model' => $model, 'id' => $model->id));
             yii::app()->end();
         }
     }
     $this->render('create', array('model' => $model));
 }