Last active
December 9, 2015 09:26
-
-
Save pzzrudlf/bd490e36fb8b0580ba29 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php $model->icon = $iconer;?>//此处是将$iconer变量的值传到icon成员变量里,在item回调函数里,用来判断是否是默认值(判断$checked是否是true) | |
| <label class = 'control-label'><?=Yii::t('app', 'Icon');?>: </label><?= MyHtml::activeRadioList($model, 'icon', $i_data,['class'=>'radio_icon', 'encode' => 0, | |
| 'item' => function ($index, $label, $name, $checked, $value){ | |
| if ($checked) {//此处对应于第一行 | |
| return Html::radio($name, ['checked'=>true],['value'=>$value,'label'=>$label]); | |
| } | |
| return Html::radio($name, $checked,['value'=>$value,'label'=>$label]); | |
| }])?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment