Closed bernhar closed 8 years ago
This is an automated comment, triggered by adding the label question
.
Please note, that the GitHub Issue Tracker is for bug reports and feature requests only.
We are happy to help you on the support forum, on IRC (#yii on freenode), or Gitter.
Please use one of the above mentioned resources to discuss the problem. If the result of the discussion turns out that there really is a bug in the framework, feel free to come back and provide information on how to reproduce the issue. This issue will be closed for now.
Same problem. It helped:
echo Html::activeLabel($model, 'is_active');
echo Html::dropDownList('Post[is_active]',
($model->is_active===false ? '0' : $model->is_active),
[false=>'No', true=>'Yes'], ['class'=>'form-control']);
I have a form. In this form I want to show a dropDownList (instead of a checkbox), as I want to know if it is blank (null), or answered (true or false). Using the following code will always bring me the PROMPT option when FALSE.
Is there a way to do so in a native fashion? Thanks