[TYPO3-ect] Using constructors within lib/div

Max Beutel nash at nashweb.de
Sun Jun 17 08:38:01 CEST 2007


Hello!

Maybe this has been discussed before, but I couldnt really find an 
answer to my problem when using constructors within lib/div.

If I have a a code like this:

class some tx_lib_controller {
     public function __construct() {
	...some stuff here...
     }

	public function catlistAction() {
	   $this->set('foo', 'bar'); // !
	}
}


I get a
Fatal error: Call to a member function offsetSet() on a non-object

When  using

class some tx_lib_controller {
	public function catlistAction() {
	   $this->set('foo', 'bar'); // !
	}
}

It works. No fatal error.

This also applies for view and model.

Is this behaviour correct/wanted? Is it an error? It would be great if 
anyone could explain whats behind this. It seems quite natural to me 
using constructors in my objects. ; )


More information about the TYPO3-team-extension-coordination mailing list