Adding Extra Key Value Pair To A Dropdown?

I have below code




echo CHtml::dropDownList('one', ((isset($data1)) ? $data1 : ""),CHtml::listData(Property::model()->findAll($criteria), 'id', 'name'), array(

            'prompt' => ((isset($name1)) ? $name1 : "Empty"),

            'id' => 'one',

            'ajax' => array(

                'type' => 'POST', //request type

                'url' => CController::createUrl('dynamicList'), //url to call.

                //Style: CController::createUrl('currentController/methodToCall')

                'update' => '#two', //selector to update

                'data' => array('one' => 'js:this.value'), //'js:javascript statement' 

            //leave out the data key to pass all form values through

        )));



it generates




<select id="one" name="one">

<option value="">one</option>

<option value="1">two</option>

<option value="3">three</option>

</select>

But I need create below with hardcoded <option>




<select id="one" name="one">

<option value="">one</option>

<option value="1">two</option>

<option value="3">three</option>

<option value="0">Another option</option>

</select>

is this possible?

yes possible you can hardcode it. but if u need ajax with dropdown list u need to write ur own ajax functions too. so using yii way is the more efficient way.

Ok I found the solution to my problem





echo CHtml::dropDownList('one', ((isset($data1)) ? $data1 : ""),CHtml::listData(Property::model()->findAll($criteria), 'id', 'name')+array("0"=>"empty"), array(

            'prompt' => ((isset($name1)) ? $name1 : "Empty"),

            'id' => 'one',

            'ajax' => array(

                'type' => 'POST', //request type

                'url' => CController::createUrl('dynamicList'), //url to call.

                //Style: CController::createUrl('currentController/methodToCall')

                'update' => '#two', //selector to update

                'data' => array('one' => 'js:this.value'), //'js:javascript statement' 

            //leave out the data key to pass all form values through

        )));

        ?>