[TYPO3] pass variables to funtion in php content element?

Ries van Twisk typo3 at rvt.dds.nl
Fri Apr 7 21:54:01 CEST 2006


Bing Du wrote:

>Ries van Twisk wrote:
>
>  
>
>>Why not:
>>
>><?php
>>$GLOBALS['a'] = 'one';
>>foo();
>>
>>function foo () {
>>
>>echo "a is {$GLOBALS['a']}";
>>}
>>
>>?>
>>
>>    
>>
This style is not recommended:

$GLOBALS[a] = 'a';
This style is
$GLOBALS['a'] = 'a';


Also it's best the put variables where they belong.
So I like this style  $GLOBALS['a'] = 'a'; Better then this style 
$a='a'; and the 'expect' to find it in $GLOBALS['...'];

Ries

>
>Thanks much for the help!  Yup, that works.  I'm still curious why mine 
>not working in Typo3 though.
>
>Bing
>_______________________________________________
>TYPO3-english mailing list
>TYPO3-english at lists.netfielders.de
>http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>  
>


-- 
Ries van Twisk
Freelance Typo3 Developer
=== Private:
email: ries at vantwisk.nl
web:   http://www.rvantwisk.nl/
skype: callto://r.vantwisk
=== Work:
email: ries at livetravelguides.com
web:   http://www.livetravelguides.com




More information about the TYPO3-english mailing list