[TYPO3-mvc] How to get to typoscipt ?
Tim Schoch | GSTALTIG
tim.schoch at gstaltig.ch
Tue Jan 18 16:03:51 CET 2011
Me again...
I'm experiencing another problem with my DI'd services, precisely my MailService. I'm trying to imiplement Bennys Mail Solution but with DI instead of extending another Class. (http://www.benny-vs-web.de/typo3/extbase-fluid-zum-rendern-von-e-mail-templates-verwenden/)
Heres my current Plain Text rendering method:
-------------------------------------
protected function getPlainTextEmailView() {
// create another instance of Fluid
$view = t3lib_div::makeInstance('Tx_Fluid_View_TemplateView');
// set the controller context
$controllerContext = $this->controller->buildControllerContext(); <- !! ERROR !! protected
$controllerContext->setRequest( $this->controller->request ); <- !! ERROR !! protected
$view->setControllerContext( $controllerContext );
// this is the default template path
$templatePath = t3lib_extMgm::extPath( $this->extensionKey ) . 'Resources/Private/Templates/Email/';
$templateFile = $templatePath.$templateName.'.txt';
// set the e-mail template
$view->setTemplatePathAndFilename( $templateFile );
// and return the new Fluid instance
return $view;
}
-------------------------------------
$this->controller contains a reference to the calling controller. Not very nice, see my previous question.
But... all the controller stuff is protected. How do I access these settings?
Thanks, Tim
More information about the TYPO3-project-typo3v4mvc
mailing list