TYPO3-如何在调度程序任务中从控制器调用动作

问题描述 投票:0回答:1

我在控制器中有一些操作的扩展名。如何在调度程序任务中调用这些操作之一?

在文件mwextension / Classes / Task / Task.php中,我想在“公共函数execute()”中调用位于“ mwextension / Classes / Controller / MyController.php”中的“公共函数datenimportAction()”

感谢您的帮助!马丁

typo3 task scheduler
1个回答
0
投票

您快到了。只需使用ObjectManager->get实例化所有extbasey内容。

$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
  \TYPO3\CMS\Extbase\Object\ObjectManager::class
); 
$controller = $objectManager->get(
  \xxx\ddd\Controller\xxxController::class
); 
$controller->datenimportAction($settingsForAction);
© www.soinside.com 2019 - 2024. All rights reserved.