[TYPO3-english] Difference between $TCA and $GLOBALS['TCA']

Xavier Perseguers xavier at typo3.org
Fri Aug 8 13:33:45 CEST 2014


Hi,

> what is the difference between using $TCA and $GLOBALS['TCA'] (used in
> my_ext/ext_tables.php and my_ext/Configuration/TCA/Model.php)?

To be precise the "$TCA" you (may) use in ext_tables.php is a globally
defined variable that happens to be visible. When you write
$GLOBALS['TCA'] you explicitly references this global variable without
having to worry if it is actually visible or not in your context.

Short (logical) info: within a class, method, ... the global $TCA will
never be visible automatically and will need to be "imported". To
prevent having a mixup of every possible notations, the TYPO3 Team now
recommends to always reference those global using the
$GLOBALS['<name-of-variable>'] notation.

Kind regards

-- 
Xavier Perseguers
TYPO3 CMS Team Member

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org



More information about the TYPO3-english mailing list