[TYPO3-english] need help on customizing TCA

Santiago santi013 at arcor.de
Sat Nov 6 07:30:38 CET 2010


Hello,

> The TCA for a given table is generally split into two files:
> 
> - the "ctrl" section goes into ext_tables.php
> - the rest of the TCA goes to tca.php
> 
> The point is that - most of the time - TYPO3 needs to know only about
> the "ctrl" section of each table. Occasionally it needs more details, in
> which case the full TCA is loaded. 

Thanks for pointing this out!

Don't know, whether I understand it right, but at closer look to tca.php it 
looks quite risky to me.

tca.php assumes, that ext_tables.php has already been evaluated, but it 
contains exactly the same assignment:

$TCA['myx'] = array( ... )

so when the interpreter sees the assignment operator it might be a trigger to 
allow garbage collection, which would result in nasty debugging sessions.

Even if you assume, that the assignment is the last operation from that 
statement, it stil looks suboptimal to me.
Wouldn't it be right to use 'array_merge' or the array-element assignments of 
the second level like:

$TCA['myx']['interface'] = array( ... );
$TCA['myx']['columns'] = array( ... );
$TCA['myx']['types'] = array( ... );
$TCA['myx']['palettes'] = array( ... );

> You may want to look at existing extensions to compare the code. In
> particular, there's one called "examples" which contains the code
> samples corresponding to the "Core API" manual. 

Thanks a lot for that hint! Will dive into ...


kind regards

Santiago



More information about the TYPO3-english mailing list