首页 > 代码库 > yii2 html下拉框

yii2 html下拉框

下拉框 带默认值

<?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();?>

 

yii2 html下拉框