How does the dropdownlist work?

Asked

Viewed 75 times

0

My code is just to add text, I am using framework Yii 1, I would like to create a dropdownlist with female and male only options.

<div class="row">
		<?php echo $form->labelEx($model,'ALU_SEXO'); ?>
		<?php echo $form->textField($model,'ALU_SEXO',array('size'=>10,'maxlength'=>10)); ?>
		
	</div>

1 answer

0

According to the framework’s own documentation 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: http://www.yiiframework.com/wiki/48/by-example-chtml/#hh5

Browser other questions tagged

You are not signed in. Login or sign up in order to post.