check this wikki link. you will get a complete idea what you have to do.
and specially this one…
DOCUMENTATION Take the Tour Tutorials Class Reference Wiki Screencasts Resources
htmlOptions explained for various controls.
report it160
12 followers
Most controls that are rendered by CHtml have an argument called $htmlOptions. This argument is an array that holds the attributes of the HTML element. For example the following code:
<?php echo CHtml::link("Yii","http://www.yiiframework.com",array("style"=>"color: orange;")); ?>
Will render this link:
<a style="color: orange;" href="http://www.yiiframework.com">Yii</a>
Some tags are more complicated, for example a drop down list is composed of multiple tags:
<select>
<option>
<option>
</select>
To get attributes onto the options, add a sub-array called "options" to your htmlOptions. For example to color each item in your drop down a different color this code:
$items = array("1" => "first", "2" => "second");
$options["options"] = array("1"=>array("style" => "color:red"), "2"=>array("style"=>"color:blue"));
echo CHtml::dropDownList("myDropDown", null, $items,$options);
Produces this html:
<select name="myDropDown" id="myDropDown">
<option value="1" style="color:red">first</option>
<option value="2" style="color:blue">second</option>
</select>