hamir
(Daliri Ha)
1
I want to show a dropdown in a form in a Yii project with for items. I know I can use
echo $form->dropDownList($model,'element_id', $Options);
in _form.php view file.
Where is the best place to fulfill $options variable ? in which file ? view ? controller ?
faridplus
(Faridplusplus)
2
it depends but here is some suggestions. if $option is:
[list=1][]the result of a DB query then it’s better to be in the controller.[]simply an array of constant values, put it in the view.[/list]