Hi,
I am using dropdownlist in activeform, but i am facing the below issue.
I get the data as an array from the database, but when I display it, even the key value is being displayed. How do I prevent that from happening?
I am getting output as below
0
First
1
Second
I want the dropdownlist to display just the data and not the key values.
First
Second
Below is my code:
$query1 = (new Query())->select('model_name')->from('cars');
$data=$query1->all();
<?= $form->field($model, ‘dealer’)->dropDownlist$data) ?>
Please help on this