我在扩展中使用了自己的流体渲染器:
/**
* Makes and returns a fluid template object
*
* @return Tx_Fluid_View_TemplateView the fluid template object
*/
protected function makeFluidTemplateObject() {
/** @var Tx_Fluid_View_TemplateView $fluidTemplate */
$fluidTemplate = t3lib_div::makeInstance('Tx_Fluid_View_TemplateView');
// Set controller context
$controllerContext = $this->buildControllerContext();
$controllerContext->setRequest($this->request);
$fluidTemplate->setControllerContext($controllerContext);
return $fluidTemplate;
}
我$fluidTemplate
稍后使用它来分配模板文件、变量并渲染它:
/**
* Gets the mail message
*
* @param mixed $registration model to give to template
* @param string $templatePath path of fluid template
*
* @return string The rendered fluid template (HTML or plain text)
*/
public function getMailMessage($registration, $templatePath) {
$mailTemplate = t3lib_div::getFileAbsFileName($templatePath);
if (!file_exists($mailTemplate)) {
throw new Exception('Mail template (' . $mailTemplate . ') not found. ');
}
$this->fluidTemplate->setTemplatePathAndFilename($mailTemplate);
// Assign variables
$this->fluidTemplate->assign('registration', $registration);
$this->fluidTemplate->assign('settings', $this->settings);
return $this->fluidTemplate->render();
}
一切正常,除了->render()
通话。自 TYPO3 4.6 以来,我收到一个错误 500,没有任何指定的异常。使用 TYPO3 4.5 LTS 它正在工作!
我希望有人有一个想法。提前致谢!