简体   繁体   English

TYPO3:使用TCA.php构建前端表单?

[英]TYPO3: Use TCA.php to build Frontend Forms?

I'm searching for a solution, to build a frontend form from the TCA.php of my TYPO3 extension. 我正在寻找一个解决方案,从我的TYPO3扩展的TCA.php构建一个前端表单。

Is there any way, to select TCA.php values, from my extension Class? 有没有办法,从我的扩展类中选择TCA.php值? I want to build a select-element with values of the TCA.php file. 我想用TCA.php文件的值构建一个select元素。

Would be amazing, if someone could give me some advice :) 会有惊人的,如果有人能给我一些建议:)

TCA is globally available. TCA在全球范围内可用。 You can select any table configuration (TCA) by using the GLOBAL variable. 您可以使用GLOBAL变量选择任何表配置(TCA)。 For example, TCA for normal content (tt_content) can be found inside 例如,可以在里面找到正常内容(tt_content)的TCA

$GLOBALS['TCA']['tt_content'] $ GLOBALS [ 'TCA'] [ 'tt_content']

TCA holds the entire table configuration, if you want to see all of it I suggest you simply print_r() the configuration of the table you would like to see. TCA保存整个表配置,如果你想看到所有这些,我建议你只需print_r()你想看到的表的配置。

The configuration for each field inside a table is stored in 表中每个字段的配置存储在

$GLOBALS['TCA']['TABLENAME']['columns']['COLUMNNAME'] $ GLOBALS [ 'TCA'] [ 'TABLENAME'] [ '列'] [ 'COLUMNNAME']

If a TCA is not yet loaded, you can load it manually with the following command: 如果尚未加载TCA,可以使用以下命令手动加载它:

t3lib_div::loadTCA('TABLENAME'); t3lib_div :: loadTCA( 'TABLENAME');

This should help you on your way. 这应该可以帮助你。

We use the wil_frontendedit extension to do this. 我们使用wil_frontendedit扩展来执行此操作。 It has basic validation and some other tricks. 它有基本的验证和一些其他技巧。 Front end forms in typo3 are historically a pain, and there are 10 different modules/ways to generate them. 错字3中的前端形式在历史上是一种痛苦,并且有10种不同的模块/方式来生成它们。

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

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