[TYPO3-mvc] Using own renderer fails since TYPO 4.6

Armin Vieweg info at professorweb.de
Thu Jan 5 10:00:31 CET 2012


My problem is solved!
See:  
http://stackoverflow.com/questions/8730954/typo3-fluid-using-own-fluid-renderer-fails-since-typo3-4-6/8734339#8734339

Am 04.01.2012, 18:07 Uhr, schrieb Armin Vieweg <info at professorweb.de>:

> Hello,
>
> with the version 4.6 much changes of fluid has been made, which makes  
> fluid much faster!
>
> I used in an extension an own renderer, which I have created so:
>
>      /**
>       * 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;
>      }
>
>
> I use this $fluidTemplate later to assign templates, variables and  
> render it:
>
>     /**
>       * 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();
>      }
>
> Everything works, except the ->render() call. I get an error 500 without  
> any specified exception.
>
> I hope someone has an idea. Thanks in advance!
> ~Armin


-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/


More information about the TYPO3-project-typo3v4mvc mailing list