public static function DropDown() { $res = array(); foreach (StreetTypes::model()->findAll() as $record) { $res[$record->idStreetTypes] = $record->StreetTypesFullName; } return $res; }
<div class="row-fluid" style="margin-top: 10px;"> <div class ="span1"> <?php echo $form->labelEx($model, 'PostIndex'); //,array('class'=>'span3')); ?> <?php echo $form->textField($model, 'PostIndex', array('class' => 'span12', 'maxlength' => 50)); ?> </div> <div class ="span2"> <?php echo $form->labelEx($model, 'StreetTypeID'); ?> <?php echo $form->dropDownList($model, 'StreetTypeID', StreetTypes::DropDown(), array('class' => 'span12')); ?> </div> <div class ="span4"> <?php echo $form->labelEx($model, 'Address'); //,array('class'=>'span3')); ?> <?php echo $form->textField($model, 'Address', array('class' => 'span12', 'maxlength' => 50)); ?> </div> <div class ="span2"> <?php echo $form->labelEx($model, 'HomeNumber'); //,array('class'=>'span3'));