/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = ROL::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['ID_ROL' => $this->ID_ROL]); $query->andFilterWhere(['like', 'ROL', $this->ROL]); return $dataProvider; }
?> <?php echo $form->field($model, "id_usuario")->input("hidden")->label(false); ?> <?php echo $form->field($model, "NOMBRE_USUARIO")->input("text"); ?> <?php echo $form->field($model, "id_departamento")->dropDownList(ArrayHelper::Map(DepartamentoTabla::find()->all(), "ID_DEPARTAMENTO", "NOMBRE_DEPARTAMENTO"), ["prompt" => "Sin informar"]); ?> <?php echo $form->field($model, "id_rol")->dropDownList(ArrayHelper::Map(ROL::find()->all(), "ID_ROL", "ROL")); ?> <?php echo $form->field($model, "EMAIL")->input("email"); ?> <?php echo $form->field($model, "password")->input("password"); ?> <?php echo $form->field($model, "password_repeat")->input("password"); ?> <?php