应用插件创建前端控制器为啥无法访问呢

迅睿框架 更新 2021-09-12 09:15:28 六个核桃

PHP程序里面

应用插件创建前端控制器为啥无法访问呢。

应用,不是模块。

'type' => 'app'

需要前端显示信息,创建了 test/Controllers/Show.php

为啥无法访问:

/index.php?s=test&c=show&id=1

提示

模块【test】不存在


只有模块才可以吗,,应用插件为啥不行呢

方案

  • 官方研发技术-张锋 #1 · 2021-09-11 20:40:27
    需要改一个名字,不要叫show
  • 六个核桃 #2 · 2021-09-11 20:44:36
    官方研发技术-张锋 改一个名称 404错了detail.php/index.php?s=test&c=detail&id=1

    <?php namespace Phpcmf\Controllers;
    
    /**
     * 二次开发时可以修改本文件,不影响升级覆盖
     */
    
    class Detail extends \Phpcmf\Home\Module
    {
    
        public function index() {
            $this->_module_init();
            $this->_Show(
                (int)\Phpcmf\Service::L('Input')->get('id'),
                [
                    'field' => dr_safe_replace(\Phpcmf\Service::L('Input')->get('field')),
                    'value' => dr_safe_replace(\Phpcmf\Service::L('Input')->get('value')),
                ],
                max(1, (int)\Phpcmf\Service::L('Input')->get('page'))
            );
        }
    
        public function time() {
            $this->_module_init();
            $this->_MyShow(
                'time',
                (int)\Phpcmf\Service::L('Input')->get('id'),
                max(1, (int)\Phpcmf\Service::L('Input')->get('page'))
            );
        }
    
        public function recycle() {
            $this->_module_init();
            $this->_MyShow(
                'recycle',
                (int)\Phpcmf\Service::L('Input')->get('id'),
                max(1, (int)\Phpcmf\Service::L('Input')->get('page'))
            );
        }
    
        public function draft() {
            $this->_module_init();
            $this->_MyShow(
                'draft',
                (int)\Phpcmf\Service::L('Input')->get('id'),
                max(1, (int)\Phpcmf\Service::L('Input')->get('page'))
            );
        }
    
        public function verify() {
            $this->_module_init();
            $this->_MyShow(
                'verify',
                (int)\Phpcmf\Service::L('Input')->get('id'),
                max(1, (int)\Phpcmf\Service::L('Input')->get('page'))
            );
        }
    
    }
  • 官方研发技术-张锋 #3 · 2021-09-11 20:49:52
    满意答案
    控制器错了,你这个是模块控制器,自己开发需要建空白控制器
  • 这是BUG #4 · 2021-09-11 21:02:49
    这是模块控制器的代码
  • 六个核桃 #5 · 2021-09-12 09:15:28
    @官方研发技术-张锋:感谢帮助

迅睿系统漏洞

站群分站系统
站群分站系统(2026-10-15)
子站域名新增llms.txt访问
GEO系统
GEO系统(2026-10-14)
修复下载zip空白地址问题 修复流量复刻和任务队列错误
GeoSeo收录宝
GeoSeo收录宝(2026-10-14)
新增 站长工具箱 前端首页自动调用meta 数据
滑块验证码 Gocaptcha
滑块验证码 Gocaptcha(2026-10-13)
基于开源项目 go-captcha 的行为验证码插件,滑动拼图、区域...
GeoSeo工具箱
GeoSeo工具箱(2026-10-13)
优化巡检任务
GeoSeo排名助手
GeoSeo排名助手(2026-10-11)
加入大模型自定义
SEO聚合关键字
SEO聚合关键字(2026-10-11)
优化关键字列表页最多支持1万篇文章,过多会导致服务器扛不住;
CMS内容同步复制
CMS内容同步复制(2026-10-10)
增加时间是否更新的开关