admin管理员组文章数量:1417041
In my TYPO3 instance there are formdefinitions. I would like to render them in a fluid template. In the manual I found this:
<html xmlns:f="; xmlns:formvh="; data-namespace-typo3-fluid="true">
<formvh:render persistenceIdentifier="mycustomform.form.yaml" />
<f:comment>and so on</f:comment>
This works in so far as the form is displayed. But the controller and the action do not point to the FormFrontend
controller and the perform
action, but to the controller and the action of the extension the formviewhelper is implemented in.
The result is that the finisher configurations of mycustomform.form.yaml
are ignored and the input values of the form are not accessible in the controller action.
With overrideConfiguration
I can define the action but I found no way to define the controller.
Here is the relevant fluid code snippet:
<formvh:render
persistenceIdentifier="EXT:custom_forms/Resources/Private/Form/Definitions/workshopform.form.yaml"
overrideConfiguration="{
renderingOptions: {
controllerAction: 'perform',
additionalParams: {
'tx_myextension_show[event]': event.uid
}
},
renderables: {
0: {
renderables: {
1: {
defaultValue: firstnamePreset
},
2: {
defaultValue: lastnamePreset
},
3: {
defaultValue: emailPreset
}
}
}
}
}"
/>
As you can see, I am able to define some preset values. This works fine.
The form action attribute is:
/myformpage?tx_myextension_show%5Baction%5D=perform
&tx_myextension_show%5Bcontroller%5D=Event
&tx_myextension_show%5Bevent%5D=5883
&cHash=e9a14175bf46ce7c4b36a44a6c1a1c9f#mycustomform
It should be:
/myformpage?tx_form_formframework%5Baction%5D=perform
&tx_form_formframework%5Bcontroller%5D=FormFrontend
&cHash=267454b014354e051279c2f58506e540#mycustomform
How can this be achieved?
In my TYPO3 instance there are formdefinitions. I would like to render them in a fluid template. In the manual I found this:
<html xmlns:f="http://typo3./ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:formvh="http://typo3./ns/TYPO3/CMS/Form/ViewHelpers" data-namespace-typo3-fluid="true">
<formvh:render persistenceIdentifier="mycustomform.form.yaml" />
<f:comment>and so on</f:comment>
This works in so far as the form is displayed. But the controller and the action do not point to the FormFrontend
controller and the perform
action, but to the controller and the action of the extension the formviewhelper is implemented in.
The result is that the finisher configurations of mycustomform.form.yaml
are ignored and the input values of the form are not accessible in the controller action.
With overrideConfiguration
I can define the action but I found no way to define the controller.
Here is the relevant fluid code snippet:
<formvh:render
persistenceIdentifier="EXT:custom_forms/Resources/Private/Form/Definitions/workshopform.form.yaml"
overrideConfiguration="{
renderingOptions: {
controllerAction: 'perform',
additionalParams: {
'tx_myextension_show[event]': event.uid
}
},
renderables: {
0: {
renderables: {
1: {
defaultValue: firstnamePreset
},
2: {
defaultValue: lastnamePreset
},
3: {
defaultValue: emailPreset
}
}
}
}
}"
/>
As you can see, I am able to define some preset values. This works fine.
The form action attribute is:
/myformpage?tx_myextension_show%5Baction%5D=perform
&tx_myextension_show%5Bcontroller%5D=Event
&tx_myextension_show%5Bevent%5D=5883
&cHash=e9a14175bf46ce7c4b36a44a6c1a1c9f#mycustomform
It should be:
/myformpage?tx_form_formframework%5Baction%5D=perform
&tx_form_formframework%5Bcontroller%5D=FormFrontend
&cHash=267454b014354e051279c2f58506e540#mycustomform
How can this be achieved?
Share Improve this question asked Jan 31 at 11:09 Stefan PadbergStefan Padberg 5272 silver badges20 bronze badges1 Answer
Reset to default 0In your perform
action make a forward to the show
action. The single view is reloaded and the form shows the next step or performs the finishers.
public function performAction(): ResponseInterface
{
return new ForwardResponse('show');
}
本文标签: TYPO3 Formframework howto render form with viewhelperStack Overflow
版权声明:本文标题:TYPO3 Formframework howto render form with viewhelper - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745265774a2650590.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论