|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Configuration needed in the modelHello there,
I do have another question refering to push the config through the whole building process. I do need some configs for creeating a dynamic php-data-file in the model. Is there any chance to have the config in the model? Do need your help. Greets Walter -- Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a _______________________________________________ TYPO3-team-extension-coordination mailing list TYPO3-team-extension-coordination@... http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-extension-coordination |
|
|
Re: Configuration needed in the modelwalk2moon wrote:
> Hello there, > > I do have another question refering to push the config through the whole building process. I do need some configs for creeating a dynamic php-data-file in the model. Is there any chance to have the config in the model? > > Do need your help. everything is available inside the controller, which itself should be available in all your models (if not, create a reference to the calling controller in your model) and then do: $this->controller->configurations->get('whatever'); Just have a look at the documentation of lib (typo3conf/ext/lib/doc/*.txt) -- kind regards, Franz Koch --------------------------------------------------- PayPal-Account: 'paypal _at_ elements-net _dot_ de' --------------------------------------------------- _______________________________________________ TYPO3-team-extension-coordination mailing list TYPO3-team-extension-coordination@... http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-extension-coordination |
|
|
Re: Configuration needed in the modelwalk2moon wrote:
Hi walk2moon*, > Is there any chance to have the config in the model? As Franz pointed out, you can access the controllers configurations via $this->controller->configurations But you should consider setting only options you really need from the controller to minimize dependencies. That could look something like this: // this method is called automatically by lib/div before each action public function doPreActionProcessings() { $modelClassName = tx_div::makeInstanceClassName($this->configurations['modelClassName']); $this->model = new $modelClassName($this); $this->model->setStoragePID($this->configurations['storagePID']) ... } So you can more easily reuse the model from another controller, hook, api whatsoever. Good luck, Bastian * the TYPO3 mailing list guidelines suggests to use real names (see http://typo3.org/community/mailing-lists/mailing-list-rules-guidelines/) _______________________________________________ TYPO3-team-extension-coordination mailing list TYPO3-team-extension-coordination@... http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-extension-coordination |
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |