[TYPO3-mvc] Beginner question - Argument passed to controller must be an instance

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Mon Feb 7 12:27:33 CET 2011


Thomas "Thasmo" Deinhamer wrote:
> $addressRepository =
> t3lib_div::makeInstance('Tx_Vsubscription_Domain_Repository_AddressRepository');

Ah, btw. - from TYPO3 4.5 on (Extbase 1.3) you should use the object 
manager, to load objects. Not sure about the syntax, but instead of 
t3lib_div::makeInstance('ABC') you should use something like 
$objectManager->create('ABC').

Examples here: 
http://forge.typo3.org/projects/typo3v4-mvc/wiki/Dependency_Injection_%28DI%29

Also see this:
http://buzz.typo3.org/teams/core/article/typo3-45-lts-extbase-and-fluid-features-and-improvements/

Regards,
Thomas


More information about the TYPO3-project-typo3v4mvc mailing list