[TYPO3-dev] TYPO3 7.0.2: Cannot connect to signalSlot [SOLVED]
Thomas Hucke
thucke at web.de
Tue Jan 13 20:21:36 CET 2015
Hi Helmut,
thank you for your help.
Your response was one part of the solution.
The other one is that I had to copy the signalSlotActionMethod of
TYPO3\CMS\Extbase\Mvc\Controller\ActionController to my own controller:
/**
* Emits a signal before the current action is called
*
* @param array $preparedArguments
*/
protected function emitBeforeCallActionMethodSignal(array
$preparedArguments) {
$this->signalSlotDispatcher->dispatch(__CLASS__, 'beforeCallActionMethod',
array(get_class($this), $this->actionMethodName, $preparedArguments));
}
Passing __CLASS__ to the dispatcher always sends
'TYPO3\CMS\Extbase\Mvc\Controller\ActionController'. So I had either
register my handler to the ActionController - which I would not like to - or
I copied the whole method to my controller. Doing so __CLASS__ passes the
classname of my controller to the dispatcher.
Just if one got a similar question....
Take care
Thomas
"Helmut Hummel" schrieb im Newsbeitrag
news:mailman.1.1421057086.13973.typo3-dev at lists.typo3.org...
Hi Thomas!
Am 11.01.15 um 17:03 schrieb Thomas Hucke:
> I try to connect my extension to a signalslot. So according to the
> documentation I found I added the following code to my ex_localconf.php:
>
> $objectManager =
> \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
> $signalSlotDispatcher =
> $objectManager->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
Just use:
$signalSlotDispatcher =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
Kind regards,
Helmut
--
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 CMS Active Contributor, TYPO3 Security Team Member
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-dev
mailing list