<?php $model->test=($model->test)?:1?>
<?= $form->field($model, 'test',[
'options'=>['class' => 'form-group form-md-radios'],
'template' => '{label}<div class="col-md-9 md-radio-inline">{input}</div>{hint}{error}',
])->radioList([1=>Yii::t('common','has'),0=>Yii::t('common','not')],
[
'item' => function($index, $label, $name, $checked, $value) {
$checked=$checked?"checked":"";
$return = '<div class="md-radio">';
$return .= '<input type="radio" id="' . $name . $value . '" name="' . $name . '" value="' . $value . '" class="md-radiobtn" '.$checked.'>';
$return .= '<label for="' . $name . $value . '">
<span></span>
<span class="check"></span>
<span class="box"></span>' . ucwords($label) . '</label>';
$return .= '</div>';
return $return;
}
]) ?>
文章
总共 0 条评论