[TYPO3-mvc] Fluid: Pass current query string to form action
Christine Gerpheide
cgerpheide at gmail.com
Wed May 5 15:51:15 CEST 2010
2010/5/5 roberto blanko <robertoblanko at gmail.com>
> Greetings fellow developers,
>
> I've got a rather complicated problem, which consists of two parts of which
> both I don't know how to realize them.
>
> First of all I want to create a form in Fluid which uses the current page
> including the whole query string (all the get parameters from third party
> extensions) as its action.
>
> I suppose this is possible somehow.
>
> But once I've done that, there's a second problem: The query string will
> contain a controller/action pair relevant for the extension rendering the
> form. The form itself has a different action. So after I took the query
> string I need to replace the action with the forms actual action.
>
> An example of what I want to to:
>
> Current URL showing the form:
>
> http://www.domain.tld/page.html?tx_myext_pi1[controller]=Form&tx_myext_pi1[action]=result&tx_otherext_pi1[param]=something
>
> The action-URL of the form now should look like this
>
> http://www.domain.tld/page.html?tx_myext_pi1[controller]=Form&tx_myext_pi1[action]=submit&tx_otherext_pi1[param]=something
>
> A nice solution would IMHO look somewhat like this:
>
> <f:form controller="Form" action="feedback" arguments="{queryString}">
>
> whereas controller and action overwrite possibly given controller action
> params within the query string.
>
> Ideas anyone? I would be really happy if anyone could give me a hint.
>
> Regards
> Roberto
> __
>
Hi,
So are you looking for the behavior of the addQueryString parameter in the
link.action viewhelper, but for the form tag? (I've never acutally used this
parameter, but the description says "@param boolean $addQueryString If set,
the current query parameters will be kept in the URI").
If so, maybe you could alter the FormViewHelper to include this parameter
(and submit a patch :)
Christine
More information about the TYPO3-project-typo3v4mvc
mailing list