[TYPO3-mvc] view renderer ignores action argument

Andreas Kiessling kiessling at pluspol.info
Thu Oct 13 21:49:03 CEST 2011


Hi,

>
> a more generic approach to this is using something like this
>
> $view->setTemplatePathAndFilename($this->view->getTemplateRootPath() .
> 'Email/TipAFriend.html');
>
> but getTemplateRootPath is not public either :p
>

You can use this to get the template rootpath. Taken from 
http://forge.typo3.org/projects/typo3v4-mvc/wiki/How_to_use_the_Fluid_Standalone_view_to_render_template_based_emails

$extbaseFrameworkConfiguration = 
$this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
$templateRootPath = 
t3lib_div::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']);
$templatePathAndFilename = $templateRootPath . 'Email/' . $templateName 
. '.html';
$emailView->setTemplatePathAndFilename($templatePathAndFilename);

But i admit, getTemplateRootPath() would come in handy ;)

Thanks Bastian for that Wiki page. That was just what i needed yesterday :)

HTH,
Andreas



More information about the TYPO3-project-typo3v4mvc mailing list