[TYPO3] Example with flexform

Dmitry Dulepov 9f4eetb02 at sneakemail.com
Tue May 8 14:26:38 CEST 2007


Livius Agrippa wrote:
> Thank you for your answer. What I wanted to say was the fact how can I
> reuse some information from the main class of the extension.
> I want to hove some general fields for the extension where the user can
> insert connection information. I can process this information in my main
> class as:
> $this->params =
> unserialize($TYPO3_CONF_VARS["EXT"]["extConf"]["my_extension"]);
> 
> How can I use the same information in
> class.my_extension_itemsProcFunc.php ? Or much better, how can I use the
> same connection?

This will work in FE but will not work in BE because your extension's 
main class will not be instantiated for BE (unless you use flexform in 
the same module).

What you can do is set a global variable, something like 
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tx_yourext']['connection'], 
to connection class in the beginning of main() and unset it at the end. 
Your flexform class should check if it is set and use if set or 
instantiate a new connection if not set. Is this clear enough or sounds 
cryptic?

-- 
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