💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
### 关键点:主键必须是数字 ``` `<?=TreeGrid::widget(\[ 'dataProvider'\=>$dataProvider, 'keyColumnName'\=>'id', 'parentColumnName'\=>'parent\_id', 'parentRootValue'\=>'0', 'pluginOptions'\=>\[ 'initialState'\=>'collapsed', // 'expanderTemplate'=> '&nbsp&nbsp&nbsp&nbsp|---', \], 'columns'\=>\[ \['class'\=>'yii\\grid\\SerialColumn'\], // \[ //     'attribute' => 'parent\_id', //     'label' => Yii::t('rbac-admin', 'parent\_id'), // \], \[ 'attribute'\=>'name', 'label'\=>Yii::t('rbac-admin','Name'), \], \[ 'attribute'\=>'description', 'label'\=>Yii::t('rbac-admin','Description'), \], \[ 'attribute'\=>'ruleName', 'label'\=>Yii::t('rbac-admin','Rule Name'), // 'filter' => $rules \], \[ 'class'\=>'common\\components\\ActionColumn', 'urlCreator'\=>function($action,$model,$key,$index){ switch($action) { case'delete': returnUrl::to(\['delete','id'\=>$model\->name,'module\_name'\=>$model\->module\_name\]); break; case'view': returnUrl::to(\['view','id'\=>$model\->name,'module\_name'\=>$model\->module\_name\]); break; case'update': returnUrl::to(\['update','id'\=>$model\->name,'module\_name'\=>$model\->module\_name\]); break; } }, \], \], \]); ?\>` ```