[TYPO3-mvc] Instantiate extbase action controller inside tslib_fe hook

Jochen Rau jochen.rau at typoplanet.de
Wed Oct 28 09:12:02 CET 2009


Hi Thomas.

Thomas "Thasmo" Deinhamer wrote:
> What is the correct way to instantiate an extbase action
> controller inside a registered typo3 tslib_fe hook?
>
> The following didn't work:
>
> Tx_Extbase_Utility_ClassLoader::loadClass('Tx_MyExt_Controller_MyController');
>
> t3lib_div::getUserObj('Tx_MyExt_Controller_MyController');
>
> The error message is:
>
> PHP Catchable Fatal Error: Argument 1 passed to
> Tx_Extbase_Persistence_Mapper_DataMapper::injectReflectionService() must
> be an instance of Tx_Extbase_Reflection_Service, null given, called in
> /var/www/library/typo3/4.3.0b2/typo3/sysext/extbase/Classes/Dispatcher.php
> on line 246 and defined in
> /var/www/library/typo3/4.3.0b2/typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.php
> line 115

You have invoke the controller by calling 
Tx_Extbase_Dispatcher::dispatch($content, $configuration). See 
Tx_Extbase_Utility_Extension how the TS configuration is being built by 
configurePlugin().

The dispatcher is responsible for the whole bootstrap an calls the 
specified controller.

Regards
Jochen


-- 
Every nit picked is a bug fixed



More information about the TYPO3-project-typo3v4mvc mailing list