[TYPO3] how to generate link

Jan Bednarik info at bednarik.org
Thu Aug 2 10:39:53 CEST 2007


> TYPO3 indeed doesn't implement the singleton pattern yet because of its
> compatibility to PHP 4. But t3lib_div::getUserObj() offers a method to use
> objects as singletons (implemented as a kind of object repository).

Since when there's a problem with php4 and singleton. Let's see: 
http://www.developertutorials.com/tutorials/php/php-singleton-design-pattern-050729/page2.html

or

function getInstance($classname) {
	if (empty($GLOBALS['instances'][$classname])) {
		$GLOBALS['instances'][$classname] = new $classname;
	}
	return $GLOBALS['instances'][$classname];
}

-- 
Jan Bednarik
www.bednarik.org - web about Typo3 in czech


More information about the TYPO3-english mailing list