‪TYPO3CMS  11.5
AbstractTemplateView.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
23 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
24 use TYPO3Fluid\Fluid\View\AbstractTemplateView as Typo3FluidAbstractTemplateView;
25 use TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException;
26 
34 abstract class ‪AbstractTemplateView extends Typo3FluidAbstractTemplateView implements ‪ViewInterface
35 {
40  protected ‪$controllerContext;
41 
47  public function ‪initializeView() {}
48 
53  public function ‪__construct(RenderingContextInterface $context = null)
54  {
55  if (!$context) {
56  $context = GeneralUtility::makeInstance(RenderingContextFactory::class)->create();
57  }
58  parent::__construct($context);
59  }
60 
72  {
73  trigger_error('Method ' . __METHOD__ . ' has been deprecated in v11 and will be removed with v12.', E_USER_DEPRECATED);
74  return true;
75  }
76 
85  {
87  $this->controllerContext = ‪$controllerContext;
88 
89  // @todo: Move these two lines elsewhere when dropping the method
90  $this->baseRenderingContext->getTemplatePaths()->fillDefaultsByPackageName($request->getControllerExtensionKey());
91  $this->baseRenderingContext->getTemplatePaths()->setFormat($request->getFormat());
92 
93  if ($this->baseRenderingContext instanceof ‪RenderingContext) {
94  $this->baseRenderingContext->‪setRequest($request);
95  $this->baseRenderingContext->setControllerContext(‪$controllerContext);
96  }
97  }
98 
103  public function ‪setTemplate($templateName)
104  {
105  $this->baseRenderingContext->setControllerAction($templateName);
106  }
107 
114  public function ‪setTemplatePathAndFilename($templatePathAndFilename)
115  {
116  $this->baseRenderingContext->getTemplatePaths()->setTemplatePathAndFilename($templatePathAndFilename);
117  }
118 
125  public function ‪setTemplateRootPaths(array $templateRootPaths)
126  {
127  $this->baseRenderingContext->getTemplatePaths()->setTemplateRootPaths($templateRootPaths);
128  }
129 
135  public function ‪getTemplateRootPaths()
136  {
137  return $this->baseRenderingContext->getTemplatePaths()->getTemplateRootPaths();
138  }
145  public function ‪setPartialRootPaths(array $partialRootPaths)
146  {
147  $this->baseRenderingContext->getTemplatePaths()->setPartialRootPaths($partialRootPaths);
148  }
149 
156  public function ‪getPartialRootPaths()
157  {
158  return $this->baseRenderingContext->getTemplatePaths()->getPartialRootPaths();
159  }
160 
167  public function ‪getLayoutRootPaths()
168  {
169  return $this->baseRenderingContext->getTemplatePaths()->getLayoutRootPaths();
170  }
171 
178  public function ‪setLayoutRootPaths(array $layoutRootPaths)
179  {
180  $this->baseRenderingContext->getTemplatePaths()->setLayoutRootPaths($layoutRootPaths);
181  }
182 }
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\__construct
‪__construct(RenderingContextInterface $context=null)
Definition: AbstractTemplateView.php:52
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\$controllerContext
‪TYPO3 CMS Extbase Mvc Controller ControllerContext $controllerContext
Definition: AbstractTemplateView.php:39
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setControllerContext
‪setControllerContext(ControllerContext $controllerContext)
Definition: AbstractTemplateView.php:83
‪TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext
Definition: ControllerContext.php:30
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\getLayoutRootPaths
‪string[] getLayoutRootPaths()
Definition: AbstractTemplateView.php:166
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\canRender
‪bool canRender(ControllerContext $controllerContext)
Definition: AbstractTemplateView.php:70
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setTemplate
‪setTemplate($templateName)
Definition: AbstractTemplateView.php:102
‪TYPO3\CMS\Fluid\View\AbstractTemplateView
Definition: AbstractTemplateView.php:35
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\initializeView
‪initializeView()
Definition: AbstractTemplateView.php:46
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\getTemplateRootPaths
‪string[] getTemplateRootPaths()
Definition: AbstractTemplateView.php:134
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\getPartialRootPaths
‪string[] getPartialRootPaths()
Definition: AbstractTemplateView.php:155
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setTemplatePathAndFilename
‪setTemplatePathAndFilename($templatePathAndFilename)
Definition: AbstractTemplateView.php:113
‪TYPO3\CMS\Extbase\Mvc\View\ViewInterface
Definition: ViewInterface.php:26
‪TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext\getRequest
‪TYPO3 CMS Extbase Mvc Request getRequest()
Definition: ControllerContext.php:86
‪TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory
Definition: RenderingContextFactory.php:51
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setLayoutRootPaths
‪setLayoutRootPaths(array $layoutRootPaths)
Definition: AbstractTemplateView.php:177
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setPartialRootPaths
‪setPartialRootPaths(array $partialRootPaths)
Definition: AbstractTemplateView.php:144
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Fluid\Core\Rendering\RenderingContext
Definition: RenderingContext.php:37
‪TYPO3\CMS\Fluid\View
Definition: AbstractTemplateView.php:16
‪TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext\setRequest
‪setRequest(Request $request)
Definition: ControllerContext.php:76
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setTemplateRootPaths
‪setTemplateRootPaths(array $templateRootPaths)
Definition: AbstractTemplateView.php:124