简体   繁体   English

TYPO3:使用函数覆盖$ GLOBALS ['TCA']

[英]TYPO3: Override $GLOBALS['TCA'] with a function

In my extension I use an tablename.php file inside the tca/override folder to override some stuff defined by another extension. 在我的扩展程序中,我使用tca / override文件夹中的tablename.php文件覆盖由另一个扩展程序定义的某些内容。 I know I can do this: 我知道我可以这样做:

$GLOBALS['TCA']['tablename']['columns']['anoption']['config']['minitems'] = 1;

But when the original file says: 但是当原始文件说:

... 'anoption''config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
        'anoption',
        ['maxitems' => 7,]

What will be the override syntax? 覆盖语法是什么? I was trying something like: 我正在尝试类似的东西:

$GLOBALS['TCA']['tablename']['columns']['anoption']['config']['anoption']['maxitems'] = 3;

But that doesn't work and I don't know what I have to insert after config since in the original file there is that getFileTCAConfig function. 但这不起作用,我也不知道在配置后必须插入什么,因为在原始文件中有getFileTCAConfig函数。

Also I was wondering how I could debug "$GLOBALS['TCA']['tablename']['columns']['anoption']" to somehow see all the suboptions, since I did not find anything inside the mysql database, I couldn't read any config from the phpMyAdmin. 我也想知道如何调试“ $ GLOBALS ['TCA'] ['tablename'] ['columns'] ['anoption']”以某种方式查看所有子选项,因为我没有在mysql数据库中找到任何东西,我无法从phpMyAdmin中读取任何配置。

I appreciate all the help! 我感谢所有的帮助!

You can debug the final TCA in the TYPO3 backend through the Configuration module in the System section. 您可以通过“ 系统”部分中的“ 配置”模块在TYPO3后端中调试最终的TCA。 Once you open that module you select $GLOBALS['TCA'] (Table configuration array) in the topmost function select box: 打开该模块后,在最上方的功能选择框中选择$ GLOBALS ['TCA'](表配置数组)

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM