业务经理

微信扫描以上二维码

028-61286886

技术咨询

自定义后台模块评论页模板的修改

迅睿框架 更新 2025-11-05 12:57:17 学习狂人

看到帖子https://www.xunruicms.com/wenda/67428.html中的提问,刚好自己需要,特把解决办法记录到这里,怕下次自己后期忘记,下次再用时就有记录,同时也方便给需要的人;


如图:

修改后

自定义后台管理中的评论模板

修改文件2个:

dayrui\App\demo\Controllers\Admin\Comment.php

dayrui\App\demo\Controllers\Admin\Comment_verify.php


代码如下:

Comment.php:

<?php namespace Phpcmf\Controllers\Admin;

/**
 * 二次开发时可以修改本文件,不影响升级覆盖
 */

class Comment extends \Phpcmf\Admin\Comment
{
    public function index()
    {
        // 设置使用news自己的评论模板
        $this->tpl_prefix = 'news_comment_';
        $this->_Admin_List();
    }
    public function add()
    {
        // 设置使用news自己的评论模板
        $this->tpl_prefix = 'news_comment_';
        $this->_Admin_Add();
    }
    public function edit()
    {
        // 设置使用news自己的评论模板
        $this->tpl_prefix = 'news_comment_';
        $this->_Admin_Edit();
    }
    public function review_index()
    {
        // 设置使用news自己的评论模板
        $this->tpl_prefix = 'news_comment_';
        $this->_Admin_Review();
    }
    public function show_index()
    {
        $this->_Admin_Show();
    }
    public function del()
    {
        $this->_Admin_Del();
    }
}


Comment_verify.php

<?php namespace Phpcmf\Controllers\Admin;

/**
 * 二次开发时可以修改本文件,不影响升级覆盖
 */

class Comment_verify extends \Phpcmf\Admin\Comment
{
    public function index()
    {
        // 设置使用news自己的评论模板
        $this->tpl_prefix = 'news_comment_';
        $this->_Admin_List();
    }
    public function edit()
    {
        // 设置使用工单自己的评论模板
        $this->tpl_prefix = 'news_comment_';
        $this->_Admin_Edit();
    }
    public function show_index()
    {
        $this->_Admin_Show();
    }
    public function del()
    {
        $this->_Admin_Del();
    }
    public function status_index()
    {
        $this->_Admin_Status();
    }
}


方案

  • 蛙蛙🌤 #1 · 2025-07-08 21:34:29
    刚好需要,感谢
  • yudeleishu #2 · 2025-10-31 13:17:11
    看看这个内容,感谢
  • 风凌君 #3 · 2025-11-01 14:23:31
    感谢分享,看看或许以后能用上
  • 小萌娃 #4 · 2025-11-05 12:57:17
    感谢分享,看看或许以后能用上

迅睿系统漏洞

独立站群系统
独立站群系统(2026-09-14)
子站独立部署时修复同步附件失败问题
在线客服
在线客服(2026-09-13)
修复删除会话报错问题 删除会话时联动删除聊天图片
在线考试竞赛系统
在线考试竞赛系统(2026-09-12)
增加投票功能 考试功能拓展 注意:更新后需要执行系统更新,更新数...
网上信箱
网上信箱(2026-09-12)
修复新版本兼容问题
GeoSeo收录宝
GeoSeo收录宝(2026-09-12)
1 优化Update.php文件,解决版本在线升级不完整问题 2 ...
GeoSeo工具箱
GeoSeo工具箱(2026-09-11)
修正历史记录推送
微信系统
微信系统(2026-09-11)
增加数据统计总览界面 账号管理增加服务和公众号的区别 菜单管理支持更...
答题系统
答题系统(2026-09-11)
一站式在线答题系统,支持真题考试、题库练习和错题本,适合培训、考证、...
阿里云滑动验证码
阿里云滑动验证码(2026-09-10)
采用阿里云验证码替换迅睿系统自带的图片验证码和滑动验证码。后台设置方...
下载Plus
下载Plus(2026-09-09)
为网站附件下载加上“计数、限次、统计、防护”四重能力:按用户组控制下...