typo3 - 如何为高级功能注册模块
问题描述
当我在typo3 cms 9.5.4 后端的菜单中选择Web/Functions 时,出现以下错误:
高级功能
未注册任何模块。请联系您的系统管理员。
我是系统管理员。我在任何地方都找不到如何注册模块。如何注册任何模块?
解决方案
就像 Peter 写的那样,Extension func 已从核心中删除,实际上并未标记为与 9.5 版兼容。并应避免使用更多。
但是遵循两个文件将帮助您注册自己的模块:
分机/扩展/ext_tables.php
// Module wizard
if (TYPO3_MODE === 'BE') {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
'web_func',
\Vendor\Extension\MyModuleFunction::class,
null,
'LLL:EXT:extension/Resources/Private/Language/locallang_module.xlf:mymodulefunction'
);
}
ext/extension/Classes/MyModuleFunction.php
<?php
namespace Vendor\Extension;
class MyModuleFunction
{
/**
* Initialize the object
*
* @param \object $pObj A reference to the parent (calling) object
* @throws \RuntimeException
*/
public function init($pObj)
{
// Required method
}
/**
* Checking for first level external objects
*/
public function checkExtObj()
{
// Required method
}
/**
* Main function creating the content for the module.
*
* @return string HTML content for the module, actually a "section" made through the parent object in $this->pObj
*/
public function main()
{
return '<h1>My module function</h1>';
}
}
推荐阅读
- python - Python:在 Excel 中将列表写入一行
- python - 使用边界框列表从图像中裁剪多个边界框
- quarkus - Quarkus 和 MongoPanache 中的本机图像问题
- pandas - 日复一日地排除具有某些价值的 ID
- r - 无法为 R 安装 Stringi(R-studio 1.1.456,OS X 10.15.2 Catalina)
- android - 标志 FLAG_ACTIVITY_CLEAR_TASK 清除与活动关联的任何任务。与活动无关的任务呢?
- java - 解释一下spring项目的结构?
- amazon-qldb - 1500 是并发 QLDB 事务的限制吗?
- linux - ASP.Net Core serilog 未在 Linux VM 中创建
- angularjs - 如何从模型中的数组中设置 ng-controller 值?