V
V
Vladislav2020-06-08 12:24:51
Yii
Vladislav, 2020-06-08 12:24:51

How to make select disabled?

Here's the code, but for some reason it doesn't work for me:

<?= $form->field($model, 'parent_id')->dropDownList(ArrayHelper::map(SocialNetwork::find()->where(['parent_id' => $PARENT_ID])->all(), 'id', 'name'), ['options' => [$model->id => ['Selected' => true]], ['disabled' => true]])->label('Выберите услугу') ?>

And yet, I got some kind of mess in the code. How can the code be made more readable?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-06-09
@cr1gger

<?= $form->field($model, 'parent_id')->dropDownList(ArrayHelper::map(SocialNetwork::find()->where(['parent_id' => $PARENT_ID])->all(), 'id', 'name'), ['disabled' => true])->label('Выберите услугу') ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question