Question: I have table `types` and i want to build `selectbox` with all values from this table
In my controller i wrote this code

```
$allRegistrationTypes = RegistrationType::model()->findAll();
$this->render('index', array('allRegistrationTypes' => $allRegistrationTypes))

```

How build selectbox in view file ?

Answer: 
You would use [`CHtml::dropDownList`](http://www.yiiframework.com/doc/api/1.1/CHtml#dropDownList-detail), or [`activeDropDownList`](http://www.yiiframework.com/doc/api/1.1/CHtml#activeDropDownList-detail) if there is a "parent" model and you want to leverage its validation rules.

If you want to make the `<select>` element multiple-selection-capable, pass in `'multiple' => 'multiple'` and `'size' => X` as part of the `$htmlOptions` parameter.
Simplest Method to get "Select Box" in YII Framework:

```
<div class="row">
    <?php
        echo $form->labelEx($model,'county');
        $data = CHtml::listData(County::model()->findAll(), 'id', 'county');
        $htmlOptions =     array('size' => '1', 'prompt'=>'-- select county --', );
        echo $form->listBox($model,'county', $data, $htmlOptions);
        echo $form->error($model,'county');
    ?>
</div>

```

Good Luck..