[TYPO3] TS Constant access from extension

Xavier Perseguers typo3 at perseguers.ch
Thu Jun 12 13:05:19 CEST 2008


Hi Peter,

>> How may I access a constant defined in my page's template from within my
>> own extension ?
>>
>> I found it in $GLOBALS['TSFE']->tmpl->flatSetup['constant-key'] but it
>> seems not to be reliable as it is not always there :-/
> 
> IMO constants are in now way ment to be used that way!
> 
> Refer the constant in your extensions TypoScript-Setup:
> plugin.tx_foobar_pixy.whatever = {$iWantThisConstant}
> 
> Now you can easily access the "constant" via $this->conf['whatever'].
> 
> How 'bout that?

It seems OK. Thanks.

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en


More information about the TYPO3-english mailing list