2 declare(strict_types = 1);
54 'message' =>
'The form has been submitted.',
55 'contentElementUid' => 0,
56 'typoscriptObjectPath' =>
'lib.tx_form.contentElementRendering'
83 $this->contentObjectRenderer = $contentObjectRenderer;
96 $contentElementUid = $this->
parseOption(
'contentElementUid');
97 $typoscriptObjectPath = $this->
parseOption(
'typoscriptObjectPath');
98 if (!empty($contentElementUid)) {
99 $pathSegments = GeneralUtility::trimExplode(
'.', $typoscriptObjectPath);
100 $lastSegment = array_pop($pathSegments);
102 foreach ($pathSegments as $segment) {
103 if (!array_key_exists($segment .
'.', $setup)) {
105 sprintf(
'TypoScript object path "%s" does not exist', $typoscriptObjectPath),
109 $setup = $setup[$segment .
'.'];
111 $this->contentObjectRenderer->start([$contentElementUid],
'');
112 $this->contentObjectRenderer->setCurrentVal((
string)$contentElementUid);
113 $message = $this->contentObjectRenderer->cObjGetSingle($setup[$lastSegment], $setup[$lastSegment .
'.'], $lastSegment);
119 $this->finisherContext->getFormRuntime()
122 $standaloneView->assignMultiple([
123 'message' => $message,
124 'isPreparedMessage' => !empty($contentElementUid),
127 return $standaloneView->render();
137 $standaloneView = $this->objectManager->get(StandaloneView::class);
139 if (!isset($this->options[
'templateName'])) {
141 'The option "templateName" must be set for the ConfirmationFinisher.',
146 $standaloneView->setTemplate($this->options[
'templateName']);
147 $standaloneView->getTemplatePaths()->fillFromConfigurationArray($this->options);
149 if (isset($this->options[
'variables']) && is_array($this->options[
'variables'])) {
150 $standaloneView->assignMultiple($this->options[
'variables']);
153 $standaloneView->assign(
'form', $formRuntime);
154 $standaloneView->assign(
'finisherVariableProvider', $this->finisherContext->getFinisherVariableProvider());
156 $standaloneView->getRenderingContext()
157 ->getViewHelperVariableContainer()
158 ->addOrUpdate(RenderRenderableViewHelper::class,
'formRuntime', $formRuntime);
160 return $standaloneView;