zoukankan      html  css  js  c++  java
  • corethink功能模块探索开发(三)让这个模块可见

    感觉corethink把thinkphp的思想复用到淋漓尽致。

    1.把opencmf.php文件配置好了后台该模块的菜单就能在安装后自动读取(分析好父子关系,否则页面死循环,apache资源占用率100%)

    Equip/opencmf.php

        <?php  
        // 模块信息配置  
        return array(  
              // 模块信息  
            'info' => array(  
                 'name'        => 'Equip',  
                'title'       => '设备',  
                'icon'        => 'fa fa-newspaper-o',  
                'icon_color'  => '#9933FF',  
                'description' => '设备模块',  
                'developer'   => 'pangPython',  
                'website'     => 'http://www.opencmf.cn',  
                'version'     => '1.0.0',  
                'dependences' => array(  
                    'Admin'   => '1.1.0',  
                    ),  
                ),  
          
             // 用户中心导航  
            'user_nav' => array(  
          
                ),  
          
            // 模块配置  
            'config' => array(  
          
                ),  
          
            // 后台菜单及权限节点配置  
            'admin_menu' => array(  
          
                '1' => array(  
                    'id' => '1',  
                    'uid' => '0',  
                    'title' => '设备',  
                    'icon' => 'fa fa-newspaper-o',  
                    ),  
          
                '2' => array(  
                    'pid' => '1',  
                    'title' => '设备管理',  
                    'icon' => 'fa fa-folder-open-o',  
                    ),  
          
                  '3' => array(  
                    'pid'   => '2',  
                    'title' => '设备配置',  
                    'icon'  => 'fa fa-wrench',  
                ),  
          
                     '4' => array(  
                    'pid'   => '2',  
                    'title' => '设备类型',  
                    'icon'  => 'fa fa-th-large',  
                ),  
              
                ),  
          
            );  
    

    2.让页面自动构建表格

    在Equip目录下的Admin目录下建立IndexAdmin.class.php

    这个文件继承AdminController,AdminController实现了登录权限检测,自动读取后台模块左侧导航栏,而AdminController继承了CommonController,CommonController实现了模板显示功能,CommonController继承了Controller

    Equip/Admin/IndexAdmin.class.php

        <?php  
        namespace EquipAdmin;  
        use AdminControllerAdminController;  
        use CommonUtilThinkPage;  
        class IndexAdmin extends AdminController{  
            public function index(){  
                     //使用Builder快速建立列表页面  
                    $builder = new CommonBuilderListBuilder();  
                    $builder->setMetaTitle('设备管理') //设置页面标题  
                            ->addTableColumn('id', 'ID')  
                            ->addTableColumn('create_time', '设备名称', 'time')  
                            ->addTableColumn('sort', '排序', 'text')  
                            ->addTableColumn('status', '状态', 'status')  
                            ->addTableColumn('right_button', '操作', 'btn')  
                            ->setExtraHtml('<div class="alert alert-success">请点击左侧的列表树进行操作</div>')  
                            ->display();  
            }  
        }  
    

    此时再安装模块,就能正常显示页面了

    效果图logo已打码

  • 相关阅读:
    vscode snippet
    OpenGL Type
    [转] fio参数详解
    [转] openchannel SSD( OCSSD)
    [转]linux内存管理
    proc/meminfo && hugepage
    [转] 从free到 page cache
    [转]linux网络协议栈(1)——链路层
    [转]linux 网络协议栈(1)——网络设备
    [转]linux网络协议栈(1)——socket buffer
  • 原文地址:https://www.cnblogs.com/mracale/p/8085675.html
Copyright © 2011-2022 走看看