【问题标题】:"Controller does not exist. Reflection failed." TYPO3“控制器不存在。反射失败。” TYPO3
【发布时间】:2020-04-10 02:35:59
【问题描述】:

我正在 TYPO3 (v 9.5.12) 中开发自己的扩展程序,当我通过管理工具单击我的扩展程序时,会弹出一条错误消息:

日志读取以下错误消息:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1278450972: 
Class Secsign\Secsign\Controller\SecsignController does not exist. 
Reflection failed.
| TYPO3\CMS\Extbase\Reflection\Exception\UnknownClassException thrown in file 
C:\xampp\htdocs\Typo9\public\typo3\sysext\extbase\Classes\Reflection\ReflectionService.php 
in line 363. Requested URL: 
http://localhost/Typo9/public/typo3/index.php?route=%%2Ftools%%2FSecsignSecsignbe%%2F&token=--AnonymizedToken--

我的 composer.json 文件如下所示。

{
    "name": "secsign/secsign",
    "type": "typo3-cms-extension",
    "description": "This extension allows users to authenticate using their smart phone running the SecSign App.",
    "authors": [
        {
            "name": "SecSign Technologies Inc.",
            "role": "Developer"
        }
    ],
    "require": {
        "typo3/cms-core": "^9.5"
    },
    "autoload": {
        "psr-4": {
            "Secsign\\Secsign\\": "Classes/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Secsign\\Secsign\\Tests\\": "Tests/"
        }
    }
}

我不明白这里的问题。我怎样才能让它工作?

【问题讨论】:

  • 1.你在作曲家模式下运行 TYPO3 吗?如果是这样 2. 您是使用 Composer 安装扩展程序(为此扩展程序使用单独的存储库)还是只有 typo3conf/ext 中的文件?
  • 在作曲家模式下运行。我只是把整个扩展文件夹移到typo3conf/ext

标签: typo3 content-management-system typo3-9.x typo3-extensions


【解决方案1】:

如果您正在开发扩展,您可能没有通过 composer 安装它。这意味着扩展的 composer.json 没有加载。您必须将自动加载信息添加到您的根 composer.json(C:\xampp\htdocs\Typo9 中的那个),直到您的扩展完成并通过 composer 安装。

    "autoload": {
        "psr-4": {
            "Secsign\\Secsign\\": "public/typo3conf/ext/secsign/Classes/"
        }
    },

检查我在此示例中使用的路径在您的情况下是否正确。然后你需要运行composer dumpautoload

【讨论】:

  • 完美的解释。感谢您的快速回答!
猜你喜欢
  • 1970-01-01
  • 2020-07-08
  • 1970-01-01
  • 2015-02-06
  • 1970-01-01
  • 2015-07-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多