/** * @param mixed $value * @param string $separator * @param string $labelField * * @return string * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception */ public function render($value = null, $separator = ', ', $labelField = 'title') { if ($value === null) { $value = $this->renderChildren(); } if ($value instanceof \TYPO3\CMS\Extbase\Persistence\ObjectStorage) { return \Ecom\EcomToolbox\Utility\Div::generateStringListFromObjectStorage($value, $separator, $labelField); } else { throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception('Value must be an instance of \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage, ' . gettype($value) . ' given.', 1429683170); } }
/** * @param string $templateFile template name (UpperCamelCase) * @param mixed $data variables to be passed to the Fluid view * * @return string */ protected function getStandAloneTemplate($templateFile, $data) { /** @var \TYPO3\CMS\Fluid\View\StandaloneView $view */ $view = $this->objectManager->get(\TYPO3\CMS\Fluid\View\StandaloneView::class); $templatePathAndFilename = $templateFile; $view->setTemplatePathAndFilename($templatePathAndFilename); $view->setControllerContext($this->controllerContext); $view->assign('data', $data); $view->setFormat('html'); return \Ecom\EcomToolbox\Utility\Div::sanitize_output($view->render()); }