呆错后台管理框架基础模块(后台菜单)开发实例

2022-06-03 23:02:33 开发文档 开发实例

初始字段

$fields = [
    'term_name'        => '菜单',//菜单名称
    'term_slug'        => 'admin/index/index',//菜单链接
    'term_info'        => 'fa-check',//菜单ICO
    'term_module'      => 'admin',//应用名
    'term_controll'    => 'menus',//固定值
    'term_action'      => 'left',//操作名(top|left)
    'term_status'      => 'normal',//状态
    'term_type'        => '_self',//打开方式
    'term_order'       => 1,
    'term_parent'      => 0,
    'term_count'       => 0,
    'term_title'       => '',
    'term_kewords'     => '',
    'term_description' => '',
];

卸载插件时删除后台菜单

model('common/Menu','loglic')->uninstall('demo'); 

安装插件时批量插入一级菜单(顶部与左侧)

model('common/Menu','loglic')->install([
[
    'term_name'     => '顶部菜单',
    'term_slug'     => 'demo/index/index',
    'term_info'     => 'fa-gear',
    'term_type'     => '_self',
    'term_action'   => 'top',
    'term_module'   => 'demo',
],
[
    'term_name'     => '菜单演示',
    'term_slug'     => 'demo',
    'term_info'     => 'fa-home',
    'term_type'     => '_self',
    'term_action'   => 'left',
    'term_module'   => 'demo',
]

]);

安装插件时批量插入二级菜单(左侧)

model('common/Menu','loglic')->install([

[
    'term_name'     => '测试1',
    'term_slug'     => 'demo/index/index',
    'term_info'     => 'fa-gear',
    'term_type'     => '_self',
    'term_action'   => 'left',
    'term_module'   => 'demo',
],
[
    'term_name'     => '测试2',
    'term_slug'     => 'demo/left/index',
    'term_info'     => 'fa-home',
    'term_type'     => '_self',
    'term_action'   => 'left',
    'term_module'   => 'demo',
]

],'菜单演示');

36

作者:admin

链接:https://demo.daicuo.cc/cms/detail/index?id=677

来源:呆错框架演示

著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

上一篇:呆错后台管理框架后台菜单列表如何扩展?

下一篇:呆错后台管理框架基础模块(动态配置)开发实例