腾讯云优惠券

呆错后台管理框架基础模块—后台菜单

人气:548 更新:2022-02-21

按应用名删除后台菜单实例(通常用于卸载插件时调用)

model('admin/Menu','loglic')->delete([
    'module' => 'test',
]);

批量添加后台一级菜单实例(通常用于插件安装时调用)

model('admin/Menu','loglic')->save([
    [
        'term_name'   => '设置',
        'term_slug'   => 'config',
        'term_info'   => 'fa-gears',
        'term_module' => 'test',
    ]
]);

批量添加后台二级菜单实例(通常用于插件安装时调用)

model('admin/Menu','loglic')->save([
    [
        'term_name'   => '视频设置',
        'term_slug'   => 'admin/video/index',
        'term_info'   => 'fa-file-movie-o',
        'term_module' => 'test',
    ],
    [
        'term_name'   => '上传设置',
        'term_slug'   => 'admin/upload/index',
        'term_info'   => 'fa-upload',
        'term_module' => 'test',
    ],
],'设置');