有两种方式:
方式一:使用 prompt
echo Html::activeDropDownList($model, 'status', ['0' => '关闭', '0' => '开启'], ['class' => 'form-control', 'prompt' => '全部']);
方式二:
echo Html::activeDropDownList($model, 'status', ['' => '全部', '0' => '关闭', '0' => '开启'], ['class' => 'form-control']);
本文由 echo 创作,采用 知识共享署名 3.0 中国大陆许可协议 进行许可。 可自由转载、引用,但需署名作者且注明文章出处。