CHtml::radioButtonList

    public function getSortList(){
        $arr = array();
        $arr[0]['id']=0;
        $arr[0]['name']="否";
        $arr[1]['id']=1;
        $arr[1]['name']="是";
        return CHtml::listData($arr, "id", "name");
        //return CHtml::radioButtonList('issort','1', $arr);
    }
<div class="row">
		<?php echo $form->labelEx($model,'issort'); ?>
		<?php echo $form->radioButtonList($model,'issort', Menu::model()->getSortList(),array('separator'=>'','template'=>'<span style="float:left;" class="radio">{input} {label}</span>')); ?>
		<?php echo $form->error($model,'issort'); ?>
	</div>

  

<style>
.radio{width:40px;}
.radio input{ float: left;}
.radio label{ float: left;margin-left:2px;}
</style>

上一篇:poj3254(状压dp入门第一道题,很详细)


下一篇:解说mysql之binlog日志以及利用binlog日志恢复数据