‪TYPO3CMS  10.4
AbstractController.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Psr\Http\Message\ServerRequestInterface;
25 
31 {
40  protected function ‪initializeStandaloneView(ServerRequestInterface $request, string $templatePath): ‪StandaloneView
41  {
42  $viewRootPath = GeneralUtility::getFileAbsFileName('EXT:install/Resources/Private/');
43  $view = GeneralUtility::makeInstance(StandaloneView::class);
44  $view->getRequest()->setControllerExtensionName('Install');
45  $view->setTemplatePathAndFilename($viewRootPath . 'Templates/' . $templatePath);
46  $view->setLayoutRootPaths([$viewRootPath . 'Layouts/']);
47  $view->setPartialRootPaths([$viewRootPath . 'Partials/']);
48  $view->assignMultiple([
49  'controller' => $request->getQueryParams()['install']['controller'] ?? 'maintenance',
50  'context' => $request->getQueryParams()['install']['context'] ?? '',
51  'composerMode' => ‪Environment::isComposerMode(),
52  'currentTypo3Version' => (string)(new ‪Typo3Version())
53  ]);
54  return $view;
55  }
56 }
‪TYPO3\CMS\Install\Controller\AbstractController\initializeStandaloneView
‪StandaloneView initializeStandaloneView(ServerRequestInterface $request, string $templatePath)
Definition: AbstractController.php:40
‪TYPO3\CMS\Core\Information\Typo3Version
Definition: Typo3Version.php:21
‪TYPO3\CMS\Install\Controller
Definition: AbstractController.php:18
‪TYPO3\CMS\Core\Core\Environment\isComposerMode
‪static bool isComposerMode()
Definition: Environment.php:144
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:34
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:40
‪TYPO3\CMS\Install\Controller\AbstractController
Definition: AbstractController.php:31
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46