[TYPO3-ect] Generated constructors in models/views (of Kickstarter MVC)

Tim Eggert eggert at portrino.de
Mon Jul 30 10:48:26 CEST 2007


Hello there,

I'm new to the list and hope I could get some help here.

My question is related to the generated constructor-methods of the models
and views, done by the kickstarter__mvc.

There is generated something like this:

class tx_extKey_model_xyz extends tx_lib_object {

    function tx_extKey_model_xyz($parameters = null) {
        parent::tx_lib_object();
    }
...
}

So it's not possible to pass some data to the model while instantiating the
model-class (as how it's done eg. in bananas):
$modelClassName = tx_div::makeInstanceClassName('tx_extKey_model_xyz');
$model = new $modelClassName($this);

Now the question:
Is it better to remove the constructor-method, so that the parent
constructor is called, or should I extend the method with the two optional
parameters like in lib_object?
Like this:
function tx_extKey_model_xyz($parameter1 = null, $parameter2 = null) {
    parent::tx_lib_object($parameter1, $parameter2);
}

Or are there any different possibilities to pass data directly?

Thanks

Tim Eggert


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