Esempio n. 1
0
 /**
  * Renders the index view for the module
  * @return string
  */
 public function actionIndex()
 {
     $new = new Registro();
     $searchModel = new RegistroSearch();
     $dataProvider = $searchModel->searchActive(Yii::$app->request->queryParams);
     if ($new->load(Yii::$app->request->post())) {
         $new->save();
     }
     $cadenas = ArrayHelper::map(Cadena::find()->where(['status' => 'active'])->orderBy('titulo')->all(), 'id', 'titulo');
     $almacenes = ArrayHelper::map(Almacen::find()->where(['status' => 'active'])->orderBy('identificador')->all(), 'id', 'identificador');
     $categorias = ArrayHelper::map(Categoria::find()->where(['status' => 'active'])->orderBy('titulo')->all(), 'id', 'titulo');
     return $this->render('index', ['new' => $new, 'cadenas' => $cadenas, 'almacenes' => $almacenes, 'categorias' => $categorias, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }