/** * This functions renders template to use in Mails and Other views * * @param array $variables Arguments for template * @param string $templatePath Choose a template * @param string $format Choose a format (txt or html) * * @return string */ public function render($variables, $templatePath = 'Default.txt', $format = 'txt') { $frameworkConfig = $this->settingsService->getFrameworkSettings(); /* @var $emailView \TYPO3\CMS\Fluid\View\StandaloneView */ $emailView = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView'); $emailView->setFormat($format); $emailView->setLayoutRootPath(GeneralUtility::getFileAbsFileName($frameworkConfig['email']['layoutRootPath'])); $emailView->setPartialRootPath(GeneralUtility::getFileAbsFileName($frameworkConfig['email']['partialRootPath'])); $emailView->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($frameworkConfig['email']['templateRootPath']) . $templatePath); $emailView->getRequest()->setPluginName(''); $emailView->getRequest()->setControllerName(''); $emailView->getRequest()->setControllerExtensionName($this->extensionName); $emailView->assignMultiple($variables); $emailView->assignMultiple(array('timestamp' => $GLOBALS['EXEC_TIME'], 'domain' => GeneralUtility::getIndpEnv('TYPO3_SITE_URL'), 'settings' => $this->settings)); return $emailView->render(); }
/** * Returns TRUE if a certain feature, identified by $featureName * should be activated, FALSE for backwards-compatible behavior. * * This is an INTERNAL API used throughout Extbase and Fluid for providing backwards-compatibility. * Do not use it in your custom code! * * @param string $featureName * @return bool */ public function isFeatureEnabled($featureName) { // Use our fixed TS settings so we have proper TS in BE context $configuration = $this->settingsService->getFrameworkSettings(); return (bool) (isset($configuration['features'][$featureName]) && $configuration['features'][$featureName]); }