Beispiel #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = AclRole::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' => $this->id, 'created_by' => $this->created_by, 'modified_by' => $this->modified_by, 'created_date' => $this->created_date, 'modified_date' => $this->modified_date]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'status', $this->status]);
     return $dataProvider;
 }
Beispiel #2
0
?>
    <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'password')->passwordInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList(['Active' => 'Active', 'Inactive' => 'Inactive'], ['prompt' => 'Select Status']);
?>


<?php 
echo $form->field($model, 'role_id')->dropDownList(ArrayHelper::map(AclRole::find()->where(['status' => 'Active'])->all(), 'id', 'name'), ['prompt' => 'Select Role']);
?>

    <div class='col-sm-12 col-md-12'>
        <div class="form-group pull-right">
<?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        </div>
    </div>

<?php 
ActiveForm::end();
?>

</div>