Я пытаюсь расширить функцию "renderTabMenu" из
"vendor/typo3/cms-backend/Classes/Form/Container /AbstractContainer.php" с моими собственными шаблонами.
Проблема в том, что для этого нет встроенного решения, хотя шаблоны в некотором роде встроены. (комментарий в исходном коде)
Я уже пытался найти решение с помощью прослушивателей событий или расширить дочерний класс TabsContainer, но пока безуспешно.
Вот функция отрисовки шаблона.
Код: Выделить всё
protected function renderTabMenu(array $menuItems, $domId, $defaultTabIndex = 1)
{
// @todo: It's unfortunate we're using Typo3Fluid TemplateView directly here. We can't
// inject BackendViewFactory here since __construct() is polluted by NodeInterface.
// Remove __construct() from NodeInterface to have DI, then use BackendViewFactory here.
$view = GeneralUtility::makeInstance(TemplateView::class);
$templatePaths = $view->getRenderingContext()->getTemplatePaths();
$templatePaths->setTemplateRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates')]);
$templatePaths->setPartialRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Partials')]);
$view->assignMultiple([
'id' => $domId,
'items' => $menuItems,
'defaultTabIndex' => $defaultTabIndex,
'wrapContent' => false,
'storeLastActiveTab' => true,
]);
return $view->render('Form/Tabs');
}
Resources/Private/Backend/Partials/ModuleTemplate/Tabs.html
Есть ли у кого-нибудь идеи, как это сделать?
Подробнее здесь: https://stackoverflow.com/questions/792 ... -rendering
Мобильная версия