TYPO3 8.X - 自动加载挂钩 [英] TYPO3 8.X - autoload Hook

查看:23
本文介绍了TYPO3 8.X - 自动加载挂钩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 TYPO3 中自动加载钩子?

How can I autoload a hook in TYPO3?

我在 ext_localconf.php 中注册了它,但它没有自动加载(除非我将它包含"在同一个文件中,这当然是一个非常丑陋的解决方案).我查看了其他扩展,但我没有找到 require 有钩子的地方.不是应该在 ext_emconf 中自动加载吗?

I register it in the ext_localconf.php, but it does not get autoloaded (unless I 'include' it in the same file which is of course an extremely ugly solution). I looked into other extensions but I don't find, where the require there hooks. Shouldn't it be autoloaded in the ext_emconf?

'autoload' => [
    'psr-4' => [
        'ID\\IndexedSearchAutocomplete\\' => 'Classes'
    ],
],

但是当不使用我丑陋的解决方案时,我收到错误消息,GeneralUtility::makeInstance 找不到我的文件.

But when don't use my ugly solution I get the error, that GeneralUtility::makeInstance can't find my file.

推荐答案

这有帮助吗?http://insight.helhum.io/post/130876393595/how-to-configure-class-loading-for-extensions-in

本文介绍了有关类加载的选项.

This article describes the options you have regarding class loading.

您可能想检查您的课程是否符合 psr-4 标准:http://www.php-fig.org/psr/psr-4/

You may want to check whether your class fulfills the psr-4 standard: http://www.php-fig.org/psr/psr-4/

这篇关于TYPO3 8.X - 自动加载挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆