how to convert FK as Combos ?

Hi, I have a lot of tables with FK,

defined in the "relations"


	 * @return array relational rules.


	public function relations()


		// NOTE: you may need to adjust the relation name and the related

		// class name for the relations automatically generated below.

		return array(

			'cliente' => array(self::BELONGS_TO, 'Cliente', 'cliente_id'),



How can I define something in "cliente" class or somewhere else, to display instead of a textBox, automatically a DropDown List ??

Best Regards


The Guide - Extending Gii chapter should lead you to the right direction.


$list_array = Model_calss::model()->with(cliente)->findAll(‘cliente_id=:id’,array(’:id’=>$id));

CHtml::dropDownList(‘name’, $id,


			   array('empty' => 'Select','class' => 'any_name'));

May be this is use full you.