[TYPO3-dev] Magento to TYPO3

Franz Holzinger franz at fholzinger.com
Wed Sep 3 09:34:24 CEST 2008


Martin Kutschker a écrit :
> Franz Holzinger schrieb:
>> TYPO3 forces all frontend extensions into the pi_base class. IMHO there
>> is no alternative API possible for TYPO3 extensions at the moment.
> 
> Why? You don't have to extend pi_base at all if you don't want to. It's
> just a custom. You have to have only a method that takes the two
> parameters $conf and $content, which you can name whatever you like.

Hello Masi,

this works fine, thanks!

Only the $cObj is still necessary if you do want to get the data out of 
the parent cObj.

I have change the class now to this (see below). This helps to get rid 
of the pibase object parameter in all init functions. So a simple API 
can be created now.

Franz


----------------------------------
class tx_ttproducts_pi1 {
	/**
	 * The backReference to the mother cObj object set at call time
	 *
	 * @var tslib_cObj
	 */
	var $cObj;

	/**
	 * Main method. Call this from TypoScript by a USER cObject.
	 */
	public function main($content,&$conf)	{
		$pibaseObj = &t3lib_div::getUserObj('&tx_ttproducts_pi1_base');
		$pibaseObj->cObj = &$this->cObj;
		$content = $pibaseObj->main($content,$conf);
		return $content;
	}
}






More information about the TYPO3-dev mailing list