typo3 将我的控制器和动作与我的前面板连接

问题描述 投票:0回答:1

我在我的扩展中创建了一个插件。我从站点包引导安装...并且我想添加一些操作来编辑和列出等。
我可以拥有我注册的内容,但我的问题是控制器没有与我的前端连接。
让我们忘记我创建的记录和插件,假设我有带有 helloWorldAction 的 TestController 来显示一些字符串或其他内容,并且我已经在 localconf.php 中完成了 configplugin,并且我检查了供应商和密钥扩展以及控制器名称。我已经创建了 html,所以它会返回该 html,但仍然不起作用。我什至尝试过

var_dump($motivation);
die('listAction called!');

查看我的控制器动作和前端之间的连接。
没有什么。就像不存在一样。
我已经尝试过

tt_content.list.20.imbus_motivation = FLUIDTEMPLATE
tt_content.list.20.imbus_motivation {
    file = EXT:imbus/Resources/Private/Templates/ImbusMotivation/List.html

    dataProcessing {
        10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
        10 {
            table = tx_imbus_domain_model_motivation
            pidInList = {$plugin.tx_imbus_domain_model_motivation.persistence.storagePid}
            where = 1=1
            orderBy = uid
            as = motivations
            dataProcessing {
                10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                10 {
                    references.fieldName = image
                }
            }
        }
    }
}

我可以看到我创建的插件中的数据,但我想添加、编辑和删除。因此,当我开始使用控制器时,它不起作用,我无法从那里获得列表。
请帮助我提供详细信息,通过一个适合您的简单示例将我的控制器连接到前端。
我正在使用 TYPO3 v11.5.32 和 PHP 8.1。

typo3
1个回答
1
投票

您正在混合两种不同的方法:

  • 带有数据处理器的内容元素
  • 插件

内容元素

这些适用于数据由 TYPO3 后端的编辑者管理并在前端显示的情况。访问者通常无法对这里的数据做太多事情。一个常见的例子是由编辑器配置的滑块。

https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/ContentElements/AddingYourOwnContentElements.html

插件

如果大量数据管理发生在 TYPO3 前端,例如,这些应该是首选。过滤、编辑、删除...

https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ExtensionArchitecture/Extbase/Reference/FrontendPlugins.html

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.