Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * getFluidValue
- *
- * @param string $templateName template name (UpperCamelCase)
- * @param array $variables variables to be passed to the Fluid view
- * @param string $format format [optional] can be txt/html
- * @return string
- */
- protected function getFluidValue($templateName, array $variables = array(), $format = "html") {
- $tmpView = $this->objectManager->create('Tx_Fluid_View_StandaloneView');
- switch ($format) {
- case "html" :
- $tmpView->setFormat('html');
- break;
- case "txt" :
- $tmpView->setFormat('txt');
- break;
- default:
- $tmpView->setFormat('html');
- break;
- }
- $extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
- $templateRootPath = t3lib_div::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']);
- $partialRootPath = t3lib_div::getFileAbsFileName($extbaseFrameworkConfiguration['view']['partialRootPath']);
- $templatePathAndFilename = $templateRootPath . $this->request->getControllerName().'/' . $templateName . ".$format";
- $extensionName = $this->request->getControllerExtensionName();
- $tmpView->getRequest()->setControllerExtensionName($extensionName);
- $tmpView->setTemplatePathAndFilename($templatePathAndFilename);
- $tmpView->setPartialRootPath($partialRootPath);
- $tmpView->assignMultiple($variables);
- $content = $tmpView->render();
- return $content;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement