[TYPO3-dev] Data exchange between USER/USER_INT

Oliver Hader oh at inpublica.de
Mon Dec 3 14:00:46 CET 2007


Hi Steffen,

Steffen Kamper schrieb:
> Hi Olly,
> 
> "Oliver Hader" <oh at inpublica.de> schrieb im Newsbeitrag 
> news:mailman.1.1196684392.2101.typo3-dev at lists.netfielders.de...
>> Hi,
>>
>> I have a TypoScript situation like this:
>>
>> 10 = COA
>> 10 {
>>  10 = USER_INT
>>  10.userFunc = tx_myext_pi1->main
>>  20 = USER
>>  20.userFunc = tx_myext_pi2->main
>> }
>>
>> The USER part (pi2) is rendering something and generates also some
>> information that is required by pi1, the USER_INT object. If the page
>> was cached once, the USER object isn't processed anymore and thus the
>> USER_INT doesn't have the required additional information.
>>
>> Currently the USER object is putting it's information to the TSFE:
>> $GLOBALS['TSFE']->config['extensionStorage']['tx_myext']['whatever'] = 1
>>
>> The $TSFE->config array is cached in the table 'cache_pages' by default
>> and thus, the USER_INT object has the required information automatically
>> on the next hit to that page.
>>
>> But my question to you is: What would you use in this case? What is your
>> best-practise?
>>
>> I'd like to set up a common rule for this situation and create some
>> methods like $TSFE->setExtensionStorageData($extKey, $data).
>>
>> Thanks in advance for your comments!
>>
> 
> You're idea is good and imho the only way to get the data. Session is the 
> wrong way because multiple windows. So the central way is the TSFE-Object.
> But in this case the USER_INT has to be on the same page, what happens if 
> you are on a different page, is the data in TSFE accessible ?

Yes, this works only if both objects are on the same page. If plugins
are on differen pages or if one object is generating data for the whole
site (e.g. a plugin that shows the wheather and is visible on every page
of a website), an own caching is required.

olly
-- 
Oliver Hader
http://inpublica.de/




More information about the TYPO3-dev mailing list