[TYPO3] Refer to plug-in in plug-in

Christian Lerrahn typo3 at penpal4u.net
Sat Aug 9 12:14:47 CEST 2008


Hi Pankaj and Dmitry,
On Fri, 08 Aug 2008 18:20:13 +0300
"Dmitry Dulepov [typo3]" <dmitry at typo3.org> wrote:

> Hi!
> 
> Pankaj Lele wrote:
> > Basically any plugin is a USER object. The simpler way is to call
> > the $this->cObj->USER() method in your plugin.
> > 
> > E.g. you would like to render a smoothgallery plugin you can do it
> > with code:
> > 
> > $conf = 
> > $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_rgsmoothgallery_pi1.']; 
> > //this reads TS setup for the plugin.
> > $content = $GLOBALS['TSFE']->cObj->USER($conf); //calls plugin to
> > get the content
> 
> It should be a separate cObject or you risk corrupting TSFE data.
> Additionally, the call to USER has different parameters than you use.
> USER is an internal function, it should not be called directly.
> 
> Correct code is:
> 
> $cObjType =
> $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_rgsmoothgallery_pi1'];
> $conf =
> $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_rgsmoothgallery_pi1.'];
> $cObj = t3lib_div::makeInstance('tslib_cObj'); $cObj->start(array(),
> '_NO_TABLE'); $content = $cObj->cObjGetSingle($cObjType, $conf);

Thanks (to both of you) for the code snippets. That is exactly what I
was hoping for. :)

Cheers,
Christian


More information about the TYPO3-english mailing list