【问题标题】:Typo3 is ext_tables.php still relevant in v8+?Typo3 ext_tables.php 在 v8+ 中是否仍然相关?
【发布时间】:2018-09-03 10:33:43
【问题描述】:

我是一名 Typoscript 新手,目前正在学习开发扩展的教程。文档似乎有点过时,所以我在几个地方搞糊涂了,特别是:

--ext_tables.php

--configuration/TCA/Overrides/tt_content.php

--configuration/TCA/Overrides/sys_template.php

...据我所知,大部分 ext_tables.php 代码现在驻留在 configuration/TCA/Overrides/tt_content.php 文件中(例如 ::registerPlugin 调用)。但是“::addStaticFile”调用现在驻留在哪里?有人说 ext_tables.php,有人说 configuration/TCA/Overrides/sys_template.php ??

你认为他们最终会弃用 ext_tables.php 吗?

T3 文档站点可以在事情发生变化时更新示例。对于新手来说非常混乱。

谢谢大家

【问题讨论】:

标签: php typo3 typo3-8.x typo3-extensions


【解决方案1】:

逐渐地,扩展文件夹的根目录将被清理。除了 TCA Override 功能和 Riccardo 向您展示的弃用功能外,TYPO3 v9 还简化了数据库表的创建,请参阅https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/9.3/Feature-85160-AutoCreateManagementDBFieldsFromTCACtrl.html

当涉及到静态 TypoScript 文件的注册时,只需检查其他核心扩展如何处理它。参见例如表单框架:https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/form/Configuration/TCA/Overrides/sys_template.php。这是当今的最佳做法。此外,使用 .typoscript 作为文件扩展名,请参阅https://docs.typo3.org/typo3cms/extensions/core/8.7/Changelog/8.7.x/Feature-78161-IntroduceTypoScriptFileExtension.html。另外,.tsconfig 应该用于 UserTS 和 PageTS,见https://docs.typo3.org/typo3cms/extensions/core/8.7/Changelog/8.5/Breaking-78384-FrontendIgnoresTCAInExtTables.html

【讨论】:

  • 感谢您的帮助。我不明白为什么将 registerPlugin()、addPlugin() 和 addPiFlexFormValue() 添加到 Overrides/tt_content.php 页面。从逻辑上讲,我会假设此文件中的任何内容都在修改 tt_content 表,而不是注册实用程序。我希望他们考虑将来将任何插件注册移动到更明显的位置。
  • 我相信这方面还会有更多的清理工作。仍然有很多遗留代码。恕我直言,下一件大事应该是摆脱新字段的所有冗余注册:将其添加到 .sql 文件中,将其添加到 TCA 中,将其添加到模型中……我很确定,v10 将改进在这个领域很多。敬请期待:)
猜你喜欢
  • 1970-01-01
  • 2011-04-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-01-16
  • 2012-01-31
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多