[TYPO3] TypoScript - userFunc - passing value
Dmitry Dulepov
9f4eetb02 at sneakemail.com
Wed May 30 14:00:48 CEST 2007
Hi!
Tomas Mrozek wrote:
> I would like to pass to the function "myFunction" specific TYPO3 data as
> the "myValue" variable, and I have just found that my knowledge of
> TypoScript is still quite messy.
It is not that. The mistake is the same as many people do. TS is not a
programing language. In other words, it is not executed, you should
understand it as it is written.
For example:
> subparts.TEST = USER
> subparts.TEST {
> userFunc = user_myClass->myFunction
> myValue = GPVar:tx_ttnews|news
> }
You will get a string with value "GPVar:tx_ttnews|news" as myValue in
$conf. It is you who define how this property is processed. If it is a
getData (as value suggests), *you* have to process it as getData.
> temp.test = TEXT
> temp.test.value = 99
>
> subparts.TEST = USER
> subparts.TEST {
> userFunc = user_myClass->myFunction
> myValue < temp.test
> }
myValue becomes "TEXT" and there will be an array with the rest of
"temp.test".
Again: TS is not a programming language! "<" oprator copies object (in
this case "TEXT" string and inner properties as array). For predefined
objects each property is processed by core. For your objects you define
how to process it.
--
Dmitry Dulepov
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)
More information about the TYPO3-english
mailing list