[TYPO3-mvc] Using a variable outside of Controller

Stefan Frömken firma at sfroemken.de
Wed Aug 31 08:13:43 CEST 2011


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


More information about the TYPO3-project-typo3v4mvc mailing list