[TYPO3-dev] [BE] makeInstance and call userfunc
Gijs Epping
gijs.epping at efocus.nl
Tue Jan 29 17:36:01 CET 2008
Francois Suter schreef:
> Hi,
>
>> Thanks, i replaced $this->IMAGE(); with
>> $GLOBALS['TSFE']->cObj->IMAGE() and that is working but not for:
>>
>> $GLOBALS['TSFE']->cObj->pi_linkTP_keepPIvars_url
>
> No, this can't work. "cObj" is an instance of tslib_cObj, but
> pi_linkTP_keepPIvars_url is a property of the tslib_pibase class.
> There's no instance of tslib_pibase in the globals, because it is
> instantianted specifically for each plugin.
>
> But if you create an instance of your plugin, e.g.
>
> $myplugin = t3lib_div::makeInstance('myplugin');
>
> then you can access the aforementioned variable as
>
> $myplugin->pi_linkTP_keepPIvars_url
>
> since your plugin class is supposed to extend tslib_pibase.
>
> HTH
>
he Francois,
In pi3 i call pi1 with this: (thanks to you)
$piConf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_efrpho_pi1.'];
$obj = t3lib_div::makeInstance("tx_efrpho_pi1");
$content = $obj->main('',$piConf);
In pi1 i tryed using $this->pi_linkTP_keepPIvars_url(); But then i get
the following error:
Fatal error: Call to a member function typoLink() on a non-object in.
This is the inititation code of pi1:
class tx_efrpho_pi1 extends tslib_pibase{
}
This should work as you say but it isn't.
Any idea's?
regards Gijs
More information about the TYPO3-dev
mailing list