‪TYPO3CMS  9.5
AbstractTemplateView.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
21 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
22 use TYPO3Fluid\Fluid\View\TemplateView;
23 
30 {
34  protected ‪$controllerContext;
35 
39  public function ‪initializeView()
40  {
41  }
42 
47  public function ‪__construct(RenderingContextInterface $context = null)
48  {
49  if (!$context) {
50  $context = GeneralUtility::makeInstance(ObjectManager::class)->get(RenderingContext::class, $this);
51  }
52  parent::__construct($context);
53  }
54 
65  {
66  return true;
67  }
68 
76  {
78  $this->controllerContext = ‪$controllerContext;
79  $this->baseRenderingContext->getTemplatePaths()->fillDefaultsByPackageName($request->getControllerExtensionKey());
80  $this->baseRenderingContext->getTemplatePaths()->setFormat($request->getFormat());
81  if ($this->baseRenderingContext instanceof ‪RenderingContext) {
82  $this->baseRenderingContext->setControllerContext(‪$controllerContext);
83  }
84  }
85 
90  public function ‪setTemplate($templateName)
91  {
92  $this->baseRenderingContext->setControllerAction($templateName);
93  }
94 
101  public function ‪setTemplatePathAndFilename($templatePathAndFilename)
102  {
103  $this->baseRenderingContext->getTemplatePaths()->setTemplatePathAndFilename($templatePathAndFilename);
104  }
105 
112  public function ‪setTemplateRootPaths(array $templateRootPaths)
113  {
114  $this->baseRenderingContext->getTemplatePaths()->setTemplateRootPaths($templateRootPaths);
115  }
116 
122  public function ‪getTemplateRootPaths()
123  {
124  return $this->baseRenderingContext->getTemplatePaths()->getTemplateRootPaths();
125  }
132  public function ‪setPartialRootPaths(array $partialRootPaths)
133  {
134  $this->baseRenderingContext->getTemplatePaths()->setPartialRootPaths($partialRootPaths);
135  }
136 
143  public function ‪getPartialRootPaths()
144  {
145  return $this->baseRenderingContext->getTemplatePaths()->getPartialRootPaths();
146  }
147 
154  public function ‪getLayoutRootPaths()
155  {
156  return $this->baseRenderingContext->getTemplatePaths()->getLayoutRootPaths();
157  }
158 
165  public function ‪setLayoutRootPaths(array $layoutRootPaths)
166  {
167  $this->baseRenderingContext->getTemplatePaths()->setLayoutRootPaths($layoutRootPaths);
168  }
169 }
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\canRender
‪bool canRender(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
Definition: AbstractTemplateView.php:63
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\__construct
‪__construct(RenderingContextInterface $context=null)
Definition: AbstractTemplateView.php:46
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\$controllerContext
‪TYPO3 CMS Extbase Mvc Controller ControllerContext $controllerContext
Definition: AbstractTemplateView.php:33
‪TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext
Definition: ControllerContext.php:21
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\getLayoutRootPaths
‪string[] getLayoutRootPaths()
Definition: AbstractTemplateView.php:153
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setTemplate
‪setTemplate($templateName)
Definition: AbstractTemplateView.php:89
‪TYPO3\CMS\Fluid\View\TemplateView
Definition: TemplateView.php:24
‪TYPO3\CMS\Fluid\View\AbstractTemplateView
Definition: AbstractTemplateView.php:30
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\initializeView
‪initializeView()
Definition: AbstractTemplateView.php:38
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\getTemplateRootPaths
‪string[] getTemplateRootPaths()
Definition: AbstractTemplateView.php:121
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\getPartialRootPaths
‪string[] getPartialRootPaths()
Definition: AbstractTemplateView.php:142
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setControllerContext
‪setControllerContext(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
Definition: AbstractTemplateView.php:74
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setTemplatePathAndFilename
‪setTemplatePathAndFilename($templatePathAndFilename)
Definition: AbstractTemplateView.php:100
‪TYPO3\CMS\Extbase\Mvc\View\ViewInterface
Definition: ViewInterface.php:21
‪TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext\getRequest
‪TYPO3 CMS Extbase Mvc Request getRequest()
Definition: ControllerContext.php:81
‪TYPO3\CMS\Fluid\View\Exception\InvalidTemplateResourceException
Definition: LegacyClassesForIde.php:72
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setLayoutRootPaths
‪setLayoutRootPaths(array $layoutRootPaths)
Definition: AbstractTemplateView.php:164
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setPartialRootPaths
‪setPartialRootPaths(array $partialRootPaths)
Definition: AbstractTemplateView.php:131
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Fluid\Core\Rendering\RenderingContext
Definition: RenderingContext.php:36
‪TYPO3\CMS\Extbase\Object\ObjectManager
Definition: ObjectManager.php:25
‪TYPO3\CMS\Fluid\View
Definition: AbstractTemplateView.php:2
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setTemplateRootPaths
‪setTemplateRootPaths(array $templateRootPaths)
Definition: AbstractTemplateView.php:111