[TYPO3-mvc] Dependeny Injection in Model class not working?
Matthias Krappitz
matthias at nospam.aemka.de
Mon Aug 15 17:40:44 CEST 2011
> DI in Models will be available in extbase version 1.4 (T3 4.6)
> http://git.typo3.org/TYPO3v4/CoreProjects/MVC/extbase.git?a=commit;h=c6c01d43b8682543346f378912bea06cf5304e6e
>
> In 1.3 you could handle it like this when you need a repositiory in a
> model:
>
> $objectManager =
> t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
> $this->categoryRepository =
> $objectManager->get('Tx_Dedontravel_Domain_Repository_CategoryRepository');
Thank you very much.
Good to know!
More information about the TYPO3-project-typo3v4mvc
mailing list