Skip to content

Instantly share code, notes, and snippets.

@potofcoffee
Last active December 30, 2016 11:05
Show Gist options
  • Save potofcoffee/1992b31e67a96bd1122f1022c22590b4 to your computer and use it in GitHub Desktop.
Save potofcoffee/1992b31e67a96bd1122f1022c22590b4 to your computer and use it in GitHub Desktop.
Initializing a Fluid view
<?php
// [...]
$this->view = new \TYPO3Fluid\Fluid\View\TemplateView();
$paths = $this->view->getTemplatePaths();
$paths->setTemplateRootPaths([
$this->app->getTemplatesPath(),
$this->module->getBasePath() . 'Resources/Private/Templates/'
]);
$paths->setLayoutRootPaths([
$this->app->getLayoutsPath(),
$this->module->getBasePath() . 'Resources/Private/Layouts/'
]);
$paths->setPartialRootPaths([
$this->app->getPartialsPath(),
$this->module->getBasePath() . 'Resources/Private/Partials/'
]);
$this->view->getRenderingContext()->setControllerName($this->getName());
$this->view->render($action);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment