[TYPO3-mvc] Using a variable outside of Controller

Johannes C. Schulz - EnzephaloN IT-Solutions info at enzephalon.de
Wed Aug 31 11:34:42 CEST 2011


Okay thanks.
But it still doesn't work...

Controller:
...
	$help = $teaseritem->getLinkbooking();
	if(!empty($help)){
		$GLOBALS['TSFE']->register['noform'] = "TRUE";
	}else{
		$GLOBALS['TSFE']->register['noform'] = "FALSE";
	}
...

TS of formhandler:
...
plugin.Tx_Formhandler.settings.predef.default.cssFile.1 =
fileadmin/Weimar/ext/formhandler/styles.css
[globalString = TSFE:register|noform = TRUE]
plugin.Tx_Formhandler.settings.predef.default.cssFile.1 >
plugin.Tx_Formhandler.settings.predef.default.cssFile.1 =
fileadmin/Weimar/ext/formhandler/styles_hidden.css
[global]
...

The globalString-Condition will not used...

Any ideas?

Johannes

-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org
[mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von
Stefan Frömken
Gesendet: Mittwoch, 31. August 2011 09:45
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: Re: [TYPO3-mvc] Using a variable outside of Controller

Try it this way:

[globalString = TSFE:register|noform = whatEver]

Stefan

Am 31.08.2011 09:09, schrieb Johannes C. Schulz - EnzephaloN IT-Solutions:
> Hi Stefan
>
> Thanks for your answer!
> A little question remains:
> If I define $GLOBALS['TSFE']->register['noform'] = $object->getLink(); 
> in my Controller.
> How I can access and use this "noform" as condition in TS?
> [userFunc = noform] might not work, or?
> ...
> [globals]
>
> Best regards
> Johannes
>
>
> -----Ursprüngliche Nachricht-----
> Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org
> [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag 
> von Stefan Frömken
> Gesendet: Mittwoch, 31. August 2011 08:14
> An: typo3-project-typo3v4mvc at lists.typo3.org
> Betreff: Re: [TYPO3-mvc] Using a variable outside of Controller
>
> Hello Johannes,
>
> answers below
>
> Stefan
>
> Am 30.08.2011 17:24, schrieb Johannes C. Schulz - EnzephaloN IT-Solutions:
>> Dear MVC-list
>>
>>
>>
>> Following problem:
>>
>>
>>
>> An extension written with extbase/fluid.
>>
>> Plugin inserted on a page.
>>
>> Within the controller I define a variable $GLOBALS['trallalla'].
> OK
>>
>> $GLOBALS['trallalla'] will be filled with a value from an object (if 
>> its not empty).
> OK
>>
>>
>>
>> In localconf.php I added a function to read $GLOBALS['trallalla'] and 
>> return TRUE or FALSE.
> Error! localconf.php is a file which will be executed before all 
> plugin-sourcecode. So...in this case $GLOBALS['trallala'] is empty.
>>
>>
>>
>> Same page, under the plugin I placed a formhandler-plugin.
> OK
>>
>> In the TS of this plugin I would like to do a condition on the 
>> function which returns TRUE or FALSE from localconf.php.
> formhandler itself has many possibilities to insert userFunctions. I 
> think you should give them a try first.
>>
>>
>>
>> But it seems, that $GLOBALS['trallalla'] isn't anymore filled when 
>> function in localconf.php tries to read it.
> That's right. See my comment above
>>
>>
>>
>> How can I define a variable which is readable by a function called in 
>> localconf.php
> No possibility
>
> A little hint: You can set $GLOBALS['TSFE']->register['whatEver'] = 
> value in your plugin and you can access this value on the same way in
formhandler.
> Maybe this helps.
>>
>>
>>
>> Hope you can help!
>>
>>
>>
>> Best regards
>>
>> Johannes
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4m
> vc
>
>

_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc




More information about the TYPO3-project-typo3v4mvc mailing list