corethink功能模块探索开发(四)让这个模块跑起来
来源:互联网 发布:淘宝怎么看全五星评价 编辑:程序博客网 时间:2024/05/17 07:06
让这个模块跑起来,太费劲了,多半原因是自己太粗心,opencmf.php中“uid”写成了“pid”,de了好几天的bug也没有搞出来,又加上最近发生了些事(brokenhearted)。。。
上报错图:
显示147行错误。而且打开那个页面apache占用率能到了100%+
上正事,让这个模块跑起来:
1.编辑Equip/opencmf.php给后台列表添加url
<?php// 模块信息配置return array( // 模块信息'info' => array( 'name' => 'Equip', 'title' => '设备', 'icon' => 'fa fa-newspaper-o', 'icon_color' => '#9933FF', 'description' => 'BZU网络设备模块', 'developer' => 'pangPython', 'website' => 'http://www.bzu.edu.cn', 'version' => '1.0.0', 'dependences' => array( 'Admin' => '1.1.0', ),), // 用户中心导航 'user_nav' => array( ), // 模块配置 'config' => array( 'show_equip' => array( 'title' => '前台设备总体情况', 'type' => 'radio', 'options' => array( '1' => '显示', '0' => '关闭', ), 'value' => '1', ), 'show_repaire' => array( 'title' => '是否开启前台报修', 'type' => 'radio', 'options' => array( '1' => '开启', '0' => '关闭', ), 'value' => '1', ), 'show_repaire_phone_num' => array( 'title' => '报修手机号', 'type' =>'textarea', 'value' => '', ), ), // 后台菜单及权限节点配置 'admin_menu' => array( '1' => array( 'id' => '1', 'pid' => '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', 'url' => 'Equip/Test/index', ), '4' => array( 'pid' => '2', 'title' => '设备管理', 'icon' => 'fa fa-dashboard', 'url' => 'Equip/DeviceManage/index', ), '5' => array( 'pid' => '4', 'title' => 'add', 'url' => 'Equip/DeviceManage/add', ), '6' => array( 'pid' => '2', 'title' => '设备类型', 'icon' => 'fa fa-th-large', 'url' => 'Equip/DeviceManage/index', ), '7' => array( 'pid' => '2', 'title' => '设备报修', 'icon' => 'fa fa-user', ), '8' => array( 'pid' => '2', 'title' => '设备概况', 'icon' => 'fa fa-area-chart', ), '9' => array( 'pid' => '2', 'title' => '拓展', 'icon' => 'fa fa-cogs', ), '10' => array( 'pid' => '2', 'title' => '关于模块', 'icon' => 'fa fa-commenting-o', ), ),);2.建立页面的控制器
新建DeviceManageAdmin.class.php
Equip/Admin/DeviceManageAdmin.class.php
<?php/** * Created by PhpStorm. * User: root * Date: 16-3-23 * Time: 下午10:10 */namespace Equip\Admin;use Admin\Controller\AdminController;use Common\Util\Think\Page;class DeviceManageAdmin extends AdminController { public function index(){ //使用Builder快速建立列表页面 $builder = new \Common\Builder\ListBuilder(); $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(); } public function add(){ }}
效果图:
完成了。
其实思路也不难:在配置文件中添加按钮的跳转链接,创建控制器,这里的控制器事opencmf重写的命名为abcdAdmin.class.php,Model可以不写,试图可以使用opencmf的Builder创建。
附加一张我的php ide的启动界面,PS-PHPStorm。挺好看的
1 0
- corethink功能模块探索开发(四)让这个模块跑起来
- corethink功能模块探索开发(三)让这个模块可见
- corethink功能模块探索开发(二)让这个模块可安装
- corethink功能模块探索开发(六)让这个模块在前台显示
- corethink功能模块探索开发(五)开启这个模块的配置
- corethink功能模块探索开发(七)模块数据库脚本
- corethink功能模块探索开发 小记
- corethink功能模块探索开发(一)根据已有模块推测目录结构
- corethink功能模块探索开发(十)前台显示公告列表
- corethink功能模块探索开发(十一)后台查询数据列表
- corethink功能模块探索开发(十二)后台添加自定义按钮
- corethink功能模块探索开发(十三)后台删除按钮
- corethink功能模块探索开发(十四)后台编辑按钮
- corethink功能模块探索开发(十五)后台新增按钮
- corethink功能模块探索开发(十六)后台搜索功能
- corethink功能模块探索开发(十七)opencmf.php 配置文件
- corethink功能模块探索开发(八)净化后台首页的系统信息
- corethink功能模块探索开发(九)移除前台的注册登录按钮
- python-language/tips/
- 戏说 TCP 三次握手 四次挥手
- 矩阵快速幂的学习
- java方法签名中参数和返回类型字母含义
- Chai3d中射线和几何对象的交点
- corethink功能模块探索开发(四)让这个模块跑起来
- Android手机连接连接PC adb调试
- 使用java通过Get请求进行爬虫操作
- 洛谷 P1579
- window下yaf的下载选择
- 第四周第五项目——用递归方法实现阶乘调用
- 父进程下的两个子进程通过管道进行通信
- [洛谷][P1503][鬼子进村][Treap]
- [ECshop系统]ECtouch如何接入手机短信验证功能