‪TYPO3CMS  9.5
AbstractBackendViewHelper.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 
20 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
21 
26 abstract class ‪AbstractBackendViewHelper extends AbstractViewHelper
27 {
34  public function ‪getDocInstance()
35  {
36  $viewHelperVariableContainer = $this->renderingContext->getViewHelperVariableContainer();
37  if ($viewHelperVariableContainer->exists(self::class, 'DocumentTemplate')) {
38  $doc = $viewHelperVariableContainer->get(self::class, 'DocumentTemplate');
39  } else {
41  $doc = GeneralUtility::makeInstance(DocumentTemplate::class);
42  $viewHelperVariableContainer->add(self::class, 'DocumentTemplate', $doc);
43  }
44 
45  return $doc;
46  }
47 
54  public function ‪getPageRenderer()
55  {
56  $viewHelperVariableContainer = $this->renderingContext->getViewHelperVariableContainer();
57  if ($viewHelperVariableContainer->exists(self::class, 'PageRenderer')) {
58  $pageRenderer = $viewHelperVariableContainer->get(self::class, 'PageRenderer');
59  } else {
61  $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
62  $viewHelperVariableContainer->add(self::class, 'PageRenderer', $pageRenderer);
63  }
64 
65  return $pageRenderer;
66  }
67 }
‪TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper\getPageRenderer
‪PageRenderer getPageRenderer()
Definition: AbstractBackendViewHelper.php:54
‪TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper
Definition: AbstractBackendViewHelper.php:27
‪TYPO3\CMS\Fluid\ViewHelpers\Be
Definition: AbstractBackendViewHelper.php:2
‪TYPO3\CMS\Core\Page\PageRenderer
Definition: PageRenderer.php:35
‪TYPO3\CMS\Backend\Template\DocumentTemplate
Definition: DocumentTemplate.php:48
‪TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper\getDocInstance
‪DocumentTemplate getDocInstance()
Definition: AbstractBackendViewHelper.php:34
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45