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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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_dataarray needs to be of format:array('value'=>'display')check CHtml::dropDownList().