<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\CmsHelp\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Form\Form; use ModStart\Grid\GridFilter; use ModStart\Support\Concern\HasFields; use Module\CmsHelp\Util\CmsHelpQuickNavUtil; class CmsHelpQuickNavController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $kC4To) { $kC4To->init('cms_help_quick_nav')->field(function ($kC4To) { $kC4To->id('id', 'ID'); $kC4To->text('name', '名称'); $kC4To->image('image', '图标'); $kC4To->textarea('summary', '介绍'); $kC4To->link('link', '链接'); $kC4To->display('created_at', L('Created At'))->listable(false); $kC4To->display('updated_at', L('Updated At'))->listable(false); })->gridFilter(function (GridFilter $bWyIm) { $bWyIm->eq('id', L('ID')); $bWyIm->like('name', L('Title')); })->hookChanged(function (Form $l3dqy) { CmsHelpQuickNavUtil::clearCache(); })->title('快捷导航')->asTree('id', 'pid', 'sort', 'name')->treeMaxLevel(2); } }