diff --git a/typo3/sysext/backend/Classes/View/BackendTemplateView.php b/typo3/sysext/backend/Classes/View/BackendTemplateView.php index 329f7e1d3977e5ce5bb1e151b4952edd0479c26d..17c42a4b33bc5fb2af050af2bb99f68b545892de 100644 --- a/typo3/sysext/backend/Classes/View/BackendTemplateView.php +++ b/typo3/sysext/backend/Classes/View/BackendTemplateView.php @@ -137,4 +137,40 @@ class BackendTemplateView implements ViewInterface { $this->templateView->initializeView(); } + + /** + * Set the root path(s) to the templates. + * + * @param array $templateRootPaths Root path(s) to the templates. + * @return void + * @api + */ + public function setTemplateRootPaths(array $templateRootPaths) + { + $this->templateView->setTemplateRootPaths($templateRootPaths); + } + + /** + * Set the root path(s) to the partials. + * + * @param array $partialRootPaths Root paths to the partials. + * @return void + * @api + */ + public function setPartialRootPaths(array $partialRootPaths) + { + $this->templateView->setPartialRootPaths($partialRootPaths); + } + + /** + * Set the root path(s) to the layouts. + * + * @param array $layoutRootPaths Root path to the layouts. + * @return void + * @api + */ + public function setLayoutRootPaths(array $layoutRootPaths) + { + $this->templateView->setLayoutRootPaths($layoutRootPaths); + } } diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-79124-AllowOverwritingOfTemplatePathsInBackendTemplateView.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-79124-AllowOverwritingOfTemplatePathsInBackendTemplateView.rst new file mode 100644 index 0000000000000000000000000000000000000000..59d41012b6468d80eebd49df3c83b8284818c1b4 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-79124-AllowOverwritingOfTemplatePathsInBackendTemplateView.rst @@ -0,0 +1,33 @@ +.. include:: ../../Includes.txt + +============================================================================ +Feature: #79124 - Allow overwriting of template paths in BackendTemplateView +============================================================================ + +See :issue:`79124` + +Description +=========== + +BackendTemplateView now allows overwriting of template paths to add your own locations for templates, partials and layouts in a BackendTemplateView based backend module. + +Impact +====== + +You can now do for example + +.. code-block:: php + + $frameworkConfiguration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); + $viewConfiguration = [ + 'view' => [ + 'templateRootPaths' => ['EXT:myext/Resources/Private/Backend/Templates'], + 'partialRootPaths' => ['EXT:myext/Resources/Private/Backend/Partials'], + 'layoutRootPaths' => ['EXT:myext/Resources/Private/Backend/Layouts'], + ], + ]; + $this->configurationManager->setConfiguration(array_merge($frameworkConfiguration, $viewConfiguration)); + + + +.. index:: Backend, PHP-API