‪TYPO3CMS  10.4
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\Exception\InvalidTemplateResourceException;
25 use TYPO3Fluid\Fluid\View\TemplateView;
26 
32 abstract class ‪AbstractTemplateView extends ‪TemplateView implements ‪ViewInterface
33 {
37  protected ‪$controllerContext;
38 
42  public function ‪initializeView()
43  {
44  }
45 
50  public function ‪__construct(RenderingContextInterface $context = null)
51  {
52  if (!$context) {
53  $context = GeneralUtility::makeInstance(ObjectManager::class)->get(RenderingContext::class, $this);
54  }
55  parent::__construct($context);
56  }
57 
68  {
69  return true;
70  }
71 
79  {
81  $this->controllerContext = ‪$controllerContext;
82  $this->baseRenderingContext->getTemplatePaths()->fillDefaultsByPackageName($request->getControllerExtensionKey());
83  $this->baseRenderingContext->getTemplatePaths()->setFormat($request->getFormat());
84  if ($this->baseRenderingContext instanceof ‪RenderingContext) {
85  $this->baseRenderingContext->setControllerContext(‪$controllerContext);
86  }
87  }
88 
93  public function ‪setTemplate($templateName)
94  {
95  $this->baseRenderingContext->setControllerAction($templateName);
96  }
97 
104  public function ‪setTemplatePathAndFilename($templatePathAndFilename)
105  {
106  $this->baseRenderingContext->getTemplatePaths()->setTemplatePathAndFilename($templatePathAndFilename);
107  }
108 
115  public function ‪setTemplateRootPaths(array $templateRootPaths)
116  {
117  $this->baseRenderingContext->getTemplatePaths()->setTemplateRootPaths($templateRootPaths);
118  }
119 
125  public function ‪getTemplateRootPaths()
126  {
127  return $this->baseRenderingContext->getTemplatePaths()->getTemplateRootPaths();
128  }
135  public function ‪setPartialRootPaths(array $partialRootPaths)
136  {
137  $this->baseRenderingContext->getTemplatePaths()->setPartialRootPaths($partialRootPaths);
138  }
139 
146  public function ‪getPartialRootPaths()
147  {
148  return $this->baseRenderingContext->getTemplatePaths()->getPartialRootPaths();
149  }
150 
157  public function ‪getLayoutRootPaths()
158  {
159  return $this->baseRenderingContext->getTemplatePaths()->getLayoutRootPaths();
160  }
161 
168  public function ‪setLayoutRootPaths(array $layoutRootPaths)
169  {
170  $this->baseRenderingContext->getTemplatePaths()->setLayoutRootPaths($layoutRootPaths);
171  }
172 }
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\__construct
‪__construct(RenderingContextInterface $context=null)
Definition: AbstractTemplateView.php:49
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\$controllerContext
‪TYPO3 CMS Extbase Mvc Controller ControllerContext $controllerContext
Definition: AbstractTemplateView.php:36
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setControllerContext
‪setControllerContext(ControllerContext $controllerContext)
Definition: AbstractTemplateView.php:77
‪TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext
Definition: ControllerContext.php:28
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\getLayoutRootPaths
‪string[] getLayoutRootPaths()
Definition: AbstractTemplateView.php:156
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\canRender
‪bool canRender(ControllerContext $controllerContext)
Definition: AbstractTemplateView.php:66
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setTemplate
‪setTemplate($templateName)
Definition: AbstractTemplateView.php:92
‪TYPO3\CMS\Fluid\View\TemplateView
Definition: TemplateView.php:25
‪TYPO3\CMS\Fluid\View\AbstractTemplateView
Definition: AbstractTemplateView.php:33
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\initializeView
‪initializeView()
Definition: AbstractTemplateView.php:41
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\getTemplateRootPaths
‪string[] getTemplateRootPaths()
Definition: AbstractTemplateView.php:124
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\getPartialRootPaths
‪string[] getPartialRootPaths()
Definition: AbstractTemplateView.php:145
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setTemplatePathAndFilename
‪setTemplatePathAndFilename($templatePathAndFilename)
Definition: AbstractTemplateView.php:103
‪TYPO3\CMS\Extbase\Mvc\View\ViewInterface
Definition: ViewInterface.php:24
‪TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext\getRequest
‪TYPO3 CMS Extbase Mvc Request getRequest()
Definition: ControllerContext.php:88
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setLayoutRootPaths
‪setLayoutRootPaths(array $layoutRootPaths)
Definition: AbstractTemplateView.php:167
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setPartialRootPaths
‪setPartialRootPaths(array $partialRootPaths)
Definition: AbstractTemplateView.php:134
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Fluid\Core\Rendering\RenderingContext
Definition: RenderingContext.php:39
‪TYPO3\CMS\Extbase\Object\ObjectManager
Definition: ObjectManager.php:28
‪TYPO3\CMS\Fluid\View
Definition: AbstractTemplateView.php:16
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setTemplateRootPaths
‪setTemplateRootPaths(array $templateRootPaths)
Definition: AbstractTemplateView.php:114