I want to be able to put an image inside the chtml::dropDownList.
But the dropdown list doesn’t display the html tags.
Is there a way to set the type=raw?
There has to be a different image for each item in the drop down list.
<?php echo CHtml::dropDownList("banner1", array(''=>''), model::getBanners()); ?>
public static function getBanners()
{
$criteria = new CDbCriteria();
$criteria->condition = 'status = '.Banner::STATUS_ACTIVE.'';
$criteria->order = "modified DESC";
$activeBanners = Banner::model()->findAll($criteria);
$bannerArray=array();
foreach ($activeBanners as $banner)
{
$bannerImage = $banner->image;
$bannerArray[$banner->id] = '<img src="'.$bannerImage.'">';
}
return $bannerArray;
}