pcrt/yii2-treeview

基于 FancyTree 的 Yii2-treeview 小部件

0.9.8 2019-06-07 15:45 UTC

This package is not auto-updated.

Last update: 2024-09-24 03:35:43 UTC


README

Treeview 提供了一个可定制的树形视图,支持多列、过滤、复选框等许多常用选项。

##安装

安装此扩展的最佳方式是通过 composer

运行以下命令之一

$ php composer.phar require pcrt/yii2-treeview "*"

或者

"pcrt/yii2-treeview": "*"

将以下内容添加到您的 composer.json 文件的 require 部分。

使用方法

扩展安装完成后,修改您的应用程序配置以包含

use pcrt\widgets\treeview\Treeview:


// with \yii\bootstrap\ActiveForm;
echo $form
    ->field($model, 'attribute')
    ->widget(
        Treeview::class,
        [
          'clientOptions' => [
            'source' => "http://www.xxxxx.it/out.json",
          ]
        ]
    );

// as widget
echo Treeview::widget([
    'id'=>'treeview',
    'name'=>'treeview',
    'clientOptions' => [
      'source' => "http://www.xxxxx.it/out.json",
    ]
]);

许可证

Yii2-Treeview 在 BSD-3 许可证下发布。有关详细信息,请参阅附带文件 LICENSE.md

享受吧!