一个封装了tab选项卡异步加载gridview的插件
composer require --prefer-dist anlewo/yii2-widget-tabgridview dev-master
在main.php文件下的modules加入
"modules" => [
'tabGridView' => [
'class' => 'anlewo\tabgridview\Module'
]
]
<?=\anlewo\tabgridview\TabGridViewWidget::widget([
'tabArray' => [
[
'title'=>'自定义标题1',
'columns' => $columns,
'searchClass' => 'admin\Modules\Index\models\SearchOrder'
],
[
'title'=>'自定义标题2',
'columns' => $columns1,
'searchClass' => 'admin\Modules\Index\models\SearchOrder1'
],
]
]);?>
需要配置RBAC路由:/tabGridView/index/index
需要配置引导文件:/vendor/yiisoft/extensions.php
'anlewo/yii2-widget-tabgridview' =>
array(
'name' => 'anlewo/yii2-widget-tabgridview',
'version' => '1.0',
'alias' =>
array(
'@anlewo/tabgridview' => $vendorDir . '/anlewo/yii2-widget-tabgridview/src',
),
),