呆错后台管理框架基础模块(栏目分类)开发实例

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

初始字段

$fields = [
    'term_name'        => 'termName',
    'term_slug'        => 'termSlug',
    'term_info'        => 'termInfo',
    'term_module'      => 'demo',
    'term_controll'    => 'category',//固定值
    'term_action'      => 'index',
    'term_status'      => 'normal',
    'term_type'        => '',
    'term_order'       => 1,
    'term_parent'      => 0,
    'term_count'       => 0,
    'term_title'       => '',
    'term_kewords'     => '',
    'term_description' => '',
];

卸载插件时删除栏目分类

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

安装插件时批量插入一级分类

model('common/Category','loglic')->install([
[
    'term_name'       => '分类1',
    'term_slug'       => 'category1',
    'term_module'     => 'demo',
    'term_type'       => 'navbar',//是否作为导航栏显示
    'term_tpl'        => 'index',//动态扩展的表单字段
],
[
    'term_name'       => '分类2',
    'term_slug'       => 'category2',
    'term_module'     => 'demo',
    'term_type'       => 'navbar',//是否作为导航栏显示
    'term_tpl'        => 'index',//动态扩展的表单字段
],

]);

安装插件时批量插入二级分类

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

[
    'term_name'       => '分类3',
    'term_slug'       => 'category3',
    'term_module'     => 'demo',
    'term_type'       => 'navbar',//是否作为导航栏显示
    'term_tpl'        => 'index',//动态扩展的表单字段
],
[
    'term_name'       => '分类4',
    'term_slug'       => 'category4',
    'term_module'     => 'demo',
    'term_type'       => 'navbar',//是否作为导航栏显示
    'term_tpl'        => 'index',//动态扩展的表单字段
],

],'分类1');

28

作者:admin

链接:https://demo.daicuo.org/cms/detail/index?id=681

来源:呆错后台管理框架

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

上一篇:呆错后台管理框架基础模块(表单字段)开发实例

下一篇:呆错后台管理框架基础模块(伪静态路由)开发实例