Reputation: 5015
I have a form with dropDownList I need to pass the data from DB to that list.
$form->dropDownList($model,'parent',$dd_data); ?>
Where and how should I define $dd_data array?
Upvotes: 0
Views: 583
Reputation: 17478
You can use CHtml::listData to populate $dd_data
, directly in the view, or use it in the controller and pass it to the view.
$dd_data
array needs to be of format: array('value'=>'display')
check CHtml::dropDownList().
Upvotes: 1