dev-master
9999999-dev
BSD-3-Clause
The Requires
- php >=5.4.0
- yiisoft/yii2 ~2.0
by E-Kevin
extension yii2 nestable wonail
Nestable 小部件, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist wonail/yii2-widget-nestable "*"
or add, (*4)
"wonail/yii2-widget-nestable": "*"
to the require section of your composer.json
file., (*5)
Once the extension is installed, simply use it in your code by :, (*6)
// 数据库里保存的数据,这里用json格式保存,部件读取时,直接decode解码即可 $value = '[{"group":"disable","title":"禁用","items":[]},{"group":"enable","title":"启用","items":[{"title":"修改头像","name":"change_avatar","id":1},{"title":"选择个人标签","name":"set_tag","id":3},{"title":"填写扩展资料","name":"expand_info","id":2}]}]'; echo $form->field($model, 'name')->widget(\wonail\nestable\Nestable::className(), [ 'items' => \yii\helpers\Json::decode($value), 'pluginOptions' => [ 'group' => 1, 'maxDepth' => 1 ] ]);
BSD-3-Clause
extension yii2 nestable wonail