How does dropDownList work?

0

My code is just to add text, I'm using the yii 1 framework, I'd like to create a dropDownList with the female and male options only.

<div class="row">
		<?php echo $form->labelEx($model,'ALU_SEXO'); ?>
		<?php echo $form->textField($model,'ALU_SEXO',array('size'=>10,'maxlength'=>10)); ?>
		
	</div>
    
asked by anonymous 17.04.2017 / 16:26

1 answer

0

According to the framework documentation itself, you can generate the dropDownList with the static method of the same name as CHtml

<?php echo CHtml::dropDownList('listname', $select, 
          array('M' => 'Male', 'F' => 'Female'));

src: link

    
17.04.2017 / 16:35