Skip to content
Snippets Groups Projects
Commit 083b583b authored by Susanne Moog's avatar Susanne Moog Committed by Anja Leichsenring
Browse files

[FEATURE] Allow definition of template paths in backend module

BackendTemplateView now allows overwriting of template paths to add your own
locations for templates, partials and layouts in a BackendTemplateView based
backend module.

Change-Id: I2d8c4b432ff23a3e9b8b527af4697f31082f64b7
Releases: master
Resolves: #79124
Reviewed-on: https://review.typo3.org/51079


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarAlexander Opitz <opitz.alexander@googlemail.com>
Tested-by: default avatarAlexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Mona Muzaffar
Reviewed-by: Mona Muzaffar
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent a526ce95
Branches
Tags
No related merge requests found
......@@ -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);
}
}
.. 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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment