Yii Listbox Tutorials

CHtml ListBox

CHtml::listBox() function is used for creating ListBox in yii framework. This post will help you to understand about how to create ListBox in different method, How to assign value, how to get ListBox value in controller, ListBox value from database in yii framework.SyntaxListBoxStatic Values For ListBoxListBox Values From DatabaseListbox GroupListbox Values In ControllerSyntax public static string activeListBox(CModel $model, string $attribute, array $data, array $htmlOptions=array ( )) [OR] public static string […]... Read More »

List Box Selection On Update In Yii

Here i added the source code of list box selection on update model of yii <div class="row"> <?php echo $form->labelEx($model,'country'); ?> <?php $country = array('1' => 'India', '2' => 'Australia', '3' => 'America', '4' => 'England','5'=>'Russia'); $selected = array( '1' => array('selected' => 'selected'), '3' => array('selected' => 'selected'), ); $htmlOptions = array('size' => '5', 'multiple' => 'true', 'options' => $selected ); echo $form->listBox($model,'country', $country, $htmlOptions); ?> <?php echo $form->error($model,'country'); […]... Read More »