[TYPO3-mvc] Instantiate extbase action controller inside tslib_fe hook
Thomas "Thasmo" Deinhamer
thasmo at gmail.com
Wed Oct 28 21:34:07 CET 2009
Hm, I've tried it in those ways:
#1 ----------------------------------------
$conf = array(
'pluginName' => 'Plugin',
'extensionName' => 'ExtensionName',
'controller' => 'Plugin',
'action' => 'index'
);
$d = new Tx_Extbase_Dispatcher;
$d->dispatch($content, $conf);
RESULT:
t3lib_error_Exception
PHP Catchable Fatal Error: Argument 1 passed to
Tx_Extbase_Configuration_FrontendConfigurationManager::setContentObject()
must be an instance of tslib_cObj, null given, called in
/var/www/library/typo3/4.3.0b2/typo3/sysext/extbase/Classes/Dispatcher.php
on line 168 and defined in
/var/www/library/typo3/4.3.0b2/typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php
line 45
RESULT:
Fatal error: Call to undefined method
tx_extensionname_hooks::initializeConfigurationManagerAndFrameworkConfiguration()
in
/var/www/library/typo3/4.3.0b2/typo3/sysext/extbase/Classes/Dispatcher.php
on line 103
#2 ----------------------------------------
$conf = array(
'pluginName' => 'Plugin',
'extensionName' => 'ExtensionName',
'controller' => 'Plugin',
'action' => 'index'
);
Tx_Extbase_Dispatcher::dispatch($content, $conf);
----------------------------------------
What I'm doing wrong here?
Thanks very much!
Jochen Rau schrieb:
> 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
>
>
More information about the TYPO3-project-typo3v4mvc
mailing list