Array to listdata

Im new in Yii and object oriented,i need some help on how to display the data from controller into layout/main.php.The table called branch and i need to display a dropdownlist at the layout.However, it returns error.Please help me.Here is the code,


public static function BranchList()


	$myList = "SELECT branch_name FROM branch";

	$rows = Yii::app()->db->createCommand($myList)->queryAll();

	return array($rows);




	&#036;optd = CHtml::listData(BranchController::BranchList());

	echo CHtml::dropDownList('listname','branch',array(&#036;optd));



see this link

My link

My link

Solved the problem based on the links…tq very much…