示例#1
0
 /**
  * Creates a new Almacen model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Almacen();
     $cadenas = Cadena::find()->where('status = "active"')->orderBy('titulo')->all();
     $cadenas = ArrayHelper::map($cadenas, 'id', 'titulo');
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model, 'cadenas' => $cadenas]);
     }
 }