下拉框 带默认值
<?php $form=ActiveForm::begin(); echo $form->field($model,‘uname‘, [‘inputOptions‘=>[‘class‘=>‘myway‘], ‘template‘=>‘<span>{label}</span>{input}‘]) ->dropDownList(ArrayHelper::map(array([‘uid‘=>1,‘uname‘=>‘xm‘]),‘uid‘,‘uname‘) ,[‘prompt‘=>‘请选择‘]); ActiveForm::end(); ?>
时间: 2024-10-08 01:12:34