[TYPO3-core] RFC: #9372: Code in class.tx_tstemplateanalyzer.php don't match with the new CGL
Stefano Kowalke
blueduck at gmx.net
Thu Sep 18 14:42:30 CEST 2008
Steffen Kamper wrote:
> Stefano Kowalke schrieb:
>> Hey,
>>
>>>> sry for the late - i don't like $GLOBALS['tmpl'], which is a approach
>>>> we don't use anywhere for this purpose.
>>>> You can change that to a class var, so $this->tmpl is available in any
>>>> function then.
>>> Did you analyse the code? There must be a reason this variables are
>>> defined as globals.
>>
>> Some variables which defined as global was not used:
>> * $theConstants defined in initialize_editor() and main() as global but
>> not using
>> * $rootLine defined in main() as global but not using
>>
>> * $tmpl and $tplRow was initiated by initialize_editor() and was using in
>> initialize_editor() and main() so this is IMHO the reason for defining as
>> globals
>>
>> Stefano
>
> tmpl is initialized in this class, so it's not needed to fiddle with
> global object, test my modified patch.
Yes i tested it and for me your modifications works.
So +1 to use 'protected $tmpl;' and '$this->tmpl'
Sorry for this possibly stupid question:
Why don't do the same with $tplRow? This variable was initialized by
initialize_editor() too.
Ok, i know why - it did not work, but why it did not work?
Stefano
--
GPG-ID: 0x2B08936D
Key-Fingerprint: 7F31 BCF0 70C0 B3B1 1235 07E9 1777 D7A0 2B08 936D
More information about the TYPO3-team-core
mailing list