联系官方销售客服

1835022288

028-61286886

开发框架 版主:迅睿框架研发组
module_content_before中如何获取当前发布数据对应的模块
类型:迅睿CMS 更新时间:2021-04-15 09:16:52

模块内容发布之前钩子module_content_before中如何获取当前发布数据对应的模块

回帖
  • #1楼    迅睿框架创始人
    2020-07-07 18:59:46
    Chrome 0
    \Phpcmf\Service::C()->module['dirname']
  • 琉惗
    #2楼    琉惗
    2020-07-07 19:09:43
    Chrome 0
    回复迅睿框架创始人
    \Phpcmf\Hooks::on('module_content_after', function($data, $old) {
        var_dump($data);
    });
    这个钩子这样用直接报错了,这些是报错信息,是改啥东西了吗
    CRITICAL - 2020-07-07 19:08:24 --> Too few arguments to function Phpcmf\Hooks::{closure}(), 1 passed and exactly 2 expected
    # http://studentmanage.cc/admin.php?s=bbs&c=home&m=edit&id=180
    # SELECT `url`
    FROM `dr_1_fang`
    ORDER BY `updatetime` desc
     LIMIT 1000
    #0 [internal function]: Phpcmf\Hooks::{closure}(Array)
    #1 E:\phpstudy_pro\WWW\studentmanage\dayrui\System\Events\Events.php(188): call_user_func(Object(Closure), Array)
    #2 E:\phpstudy_pro\WWW\studentmanage\dayrui\Fcms\Model\Content.php(349): CodeIgniter\Events\Events::trigger('module_content_...', Array)
    #3 E:\phpstudy_pro\WWW\studentmanage\dayrui\Fcms\Core\Table.php(211): Phpcmf\Model\Content->save(180, Array, Array)
    #4 E:\phpstudy_pro\WWW\studentmanage\dayrui\Fcms\Control\Admin\Module.php(1200): Phpcmf\Table->_Save(180, Array, Array, Object(Closure), Object(Closure))
    #5 E:\phpstudy_pro\WWW\studentmanage\dayrui\Fcms\Core\Table.php(330): Phpcmf\Admin\Module->_Save(180, Array, Array)
    #6 E:\phpstudy_pro\WWW\studentmanage\dayrui\Fcms\Control\Admin\Module.php(179): Phpcmf\Table->_Post(180, Array)
    #7 E:\phpstudy_pro\WWW\studentmanage\dayrui\App\Bbs\Controllers\Admin\Home.php(19): Phpcmf\Admin\Module->_Admin_Edit()
    #8 E:\phpstudy_pro\WWW\studentmanage\dayrui\System\CodeIgniter.php(910): Phpcmf\Controllers\Admin\Home->edit()
    #9 E:\phpstudy_pro\WWW\studentmanage\dayrui\System\CodeIgniter.php(398): CodeIgniter\CodeIgniter->runController(Object(Phpcmf\Controllers\Admin\Home))
    #10 E:\phpstudy_pro\WWW\studentmanage\dayrui\System\CodeIgniter.php(306): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
    #11 E:\phpstudy_pro\WWW\studentmanage\dayrui\Fcms\Init.php(330): CodeIgniter\CodeIgniter->run()
    #12 E:\phpstudy_pro\WWW\studentmanage\index.php(47): require('E:\\phpstudy_pro...')
    #13 E:\phpstudy_pro\WWW\studentmanage\admin.php(9): require('E:\\phpstudy_pro...')
    #14 {main}
  • #3楼    迅睿框架创始人
    2020-07-07 19:19:58
    Chrome 0
    主程序不是最新的版本,更新下cms程序文件
    满意答案
  • 琉惗
    #4楼    琉惗
    2021-04-15 09:16:52
    Chrome 0
    迅睿框架创始人:.................................