On 16.11.2010, at 10:40, Miha Vrhovnik wrote:

> So how would one do a redirect after form was POSTed and successfully
> persisted into the db?


Well the current setRedirect() should just be a helper to load the view layer. 
that being said, while its obvious how setting the content will work that way 
.. its a lot less clear how, and if it even makes sense, to set the headers in 
the templates too.

Now we could also leave things as is and simply require replacing the default 
Response service. However here its a bit inconvenient that setRedirect expects 
an URL. in the case where the URL points back to your application you might 
actually want to actually load the content for the given URL right away, 
meaning you would have to match the URL to get the route again similar to what 
I did in the MultiplexController [1]. Here it would be useful if it would be 
possible to pass the route name and any parameters instead of a URL to 
setRedirect() .. of course this would mean that the Response needs access to 
the routing layer to be able to generate the URL.

Of course if we use the templating layer to generate the output, it would be 
trivial to generate the URL inside a template, but again this requires being 
able to set the headers from inside the template.

regards,
Lukas Kahwe Smith
[email protected]

[1] 
https://github.com/liip/MultiplexBundle/blob/master/Controller/MultiplexController.php#L81

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to