/** * @return \TYPO3\Fluid\View\StandaloneView * @throws \TYPO3\Form\Exception\FinisherException */ protected function initializeStandaloneView() { $standaloneView = new \TYPO3\Fluid\View\StandaloneView(); if (!isset($this->options['templatePathAndFilename'])) { throw new \TYPO3\Form\Exception\FinisherException('The option "templatePathAndFilename" must be set for the EmailFinisher.', 1327058829); } $standaloneView->setTemplatePathAndFilename($this->options['templatePathAndFilename']); if (isset($this->options['partialRootPath'])) { $standaloneView->setPartialRootPath($this->options['partialRootPath']); } if (isset($this->options['layoutRootPath'])) { $standaloneView->setLayoutRootPath($this->options['layoutRootPath']); } if (isset($this->options['variables'])) { $standaloneView->assignMultiple($this->options['variables']); } return $standaloneView; }
/** * Prepares a Fluid view for rendering the custom error page. * * @param \Exception $exception * @param array $renderingOptions Rendering options as defined in the settings * @return \TYPO3\Fluid\View\StandaloneView */ protected function buildCustomFluidView(\Exception $exception, array $renderingOptions) { $statusCode = 500; $referenceCode = NULL; if ($exception instanceof \TYPO3\Flow\Exception) { $statusCode = $exception->getStatusCode(); $referenceCode = $exception->getReferenceCode(); } $statusMessage = \TYPO3\Flow\Http\Response::getStatusMessageByCode($statusCode); $fluidView = new \TYPO3\Fluid\View\StandaloneView(); $fluidView->setTemplatePathAndFilename($renderingOptions['templatePathAndFilename']); if (isset($renderingOptions['layoutRootPath'])) { $fluidView->setLayoutRootPath($renderingOptions['layoutRootPath']); } if (isset($renderingOptions['partialRootPath'])) { $fluidView->setPartialRootPath($renderingOptions['partialRootPath']); } if (isset($renderingOptions['format'])) { $fluidView->setFormat($renderingOptions['format']); } if (isset($renderingOptions['variables'])) { $fluidView->assignMultiple($renderingOptions['variables']); } $fluidView->assignMultiple(array('exception' => $exception, 'renderingOptions' => $renderingOptions, 'statusCode' => $statusCode, 'statusMessage' => $statusMessage, 'referenceCode' => $referenceCode)); return $fluidView; }