[TYPO3-dev] Instantiating a cObject
Brian Slezak
brian.slezak at cor.org
Thu Jun 22 22:10:06 CEST 2006
All,
My primary question is whether this is good form, or there is a better way
to get at the proper TypoScript config. What I need to do is create an
instance
of a cObject from PHP in another fe plug-in, but have its TypoScript
configuration passed to it. I've
accomplished this by this example:
(pseudo-code, incomplete, included through a static template)
my_cObject = USER
my_cObject {
...
}
>From some other fe plug-in:
require_once(PATH_typo3conf . 'ext/path/class.my_cObject .php');
...
$my_class = t3lib_div::makeInstance('my_cObject );
$content =
$this->cObj->cObjGetSingle($GLOBALS['TSFE']->tmpl->setup['plugin.']['my_cObject'],
$GLOBALS['TSFE']->tmpl->setup['plugin.']['my_cObject.']);
Stating the question again, is it ok to go at the TypoScript configuration
via $GLOBALS['TSFE']->tmpl->setup['plugin.']['my_cObject'] like that, or is
there a better way to accomplish this?
Thanks all!
"Do not put out the Spirit's fire; Test everything. Hold on to the good." --
1 Thessalonians 5:19,21,22
------
Brian Slezak
More information about the TYPO3-dev
mailing list