‪TYPO3CMS  10.4
TemplateView.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 
16 namespace ‪TYPO3\CMS\Fluid\View;
17 
19 use TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException;
20 
25 {
31  public function ‪setLayoutPathAndFilename($layoutPathAndFilename)
32  {
33  $this->baseRenderingContext->getTemplatePaths()->setLayoutPathAndFilename($layoutPathAndFilename);
34  }
35 
42  public function ‪canRender(‪ControllerContext $controllerContext)
43  {
44  try {
45  $request = $controllerContext->‪getRequest();
46  $this->setControllerContext($controllerContext);
47  $this->baseRenderingContext->getTemplatePaths()->setFormat($request->getFormat());
48  $this->baseRenderingContext->getTemplatePaths()->getTemplateSource($request->getControllerName(), $request->getControllerActionName());
49  return true;
50  } catch (InvalidTemplateResourceException $e) {
51  return false;
52  }
53  }
54 }
‪TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext
Definition: ControllerContext.php:28
‪TYPO3\CMS\Fluid\View\TemplateView
Definition: TemplateView.php:25
‪TYPO3\CMS\Fluid\View\AbstractTemplateView
Definition: AbstractTemplateView.php:33
‪TYPO3\CMS\Fluid\View\TemplateView\canRender
‪bool canRender(ControllerContext $controllerContext)
Definition: TemplateView.php:42
‪TYPO3\CMS\Fluid\View\TemplateView\setLayoutPathAndFilename
‪setLayoutPathAndFilename($layoutPathAndFilename)
Definition: TemplateView.php:31
‪TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext\getRequest
‪TYPO3 CMS Extbase Mvc Request getRequest()
Definition: ControllerContext.php:88
‪TYPO3\CMS\Fluid\View
Definition: AbstractTemplateView.php:16