• Home
  • Services
  • Extensions
    • OAuth2 Server + Client
    • Cardealer
    • Questionaire
    • Sitepackage
  • Blog
  • Kontakt

StandaloneView FLUID Template Rendering

01/07/2023 Extbase

if (!$this->view) {
    /** @var \TYPO3\CMS\Fluid\View\StandaloneView $tempView */
$tempView = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
    $tempView->setLayoutRootPaths(['EXT:my_ext/Resources/Private/Layouts']);
    $tempView->setTemplateRootPaths(['EXT:my_ext/Resources/Private/Templates']);
    $tempView->setPartialRootPaths(['EXT:my_ext/Resources/Private/Partials']);
    $templatePathAndFilename = 'EXT:my_ext/Resources/Private/Templates/New.html';
    $tempView->setTemplatePathAndFilename($templatePathAndFilename);
    $tempHtml = $tempView->render();
    return $this->htmlResponse($tempHtml);
}
Back