该控件的github地址,https://github.com/softark/yii2-dual-listbox
下面是我的代码
echo DualListbox::widget([ 'model' => $model, 'attribute' => 'attrs_ids', 'items' => \yii\helpers\ArrayHelper::map($model->getAllAttr(), 'id', 'name'), // 'options' => [], 'clientOptions' => [ 'moveOnSelect' => true, 'selectedListLabel' => Yii::t('app.c2', 'Selected Items'), 'nonSelectedListLabel' => Yii::t('app.c2', 'Available Items'), ], ]);
额,这种个人组件还是建议给原作者直接发issue。