It would be nice to emulate similar functionality to rails in which
you can respond_with a collection or an object and the action will
detect what Content-Type it should respond with.
On May 12, 8:13 am, Christophe COEVOET s...@notk.org wrote:
Le 12/05/2011 14:04, Javier Garcia a crit :
On
Le 12/05/2011 13:34, Javier Garcia a écrit :
Since for rendering templates you have to use this:
return $this-render('FooBarBundle:Default:index.html.twig');
wouldn't be more natural implementing something like:
$this-render(json_encode($data), 'json'); ???
The second argument would set the
On May 12, 1:51 pm, Christophe COEVOET s...@notk.org wrote:
the render method is not about creating a response. It is about creating
a response *with a content set by a template*.
Yes, but.. why not implement render() to create responses whose
*content could be 'anything' (JSON data for
Le 12/05/2011 14:04, Javier Garcia a écrit :
On May 12, 1:51 pm, Christophe COEVOETs...@notk.org wrote:
the render method is not about creating a response. It is about creating
a response *with a content set by a template*.
Yes, but.. why not implement render() to create responses whose
Yeah worked that one out after posting on here... although prefered
the old renderText method of sfActions in sf 1.x as this was a bit
cleaner. :-) Creating a new response object just seems an odd way to
do it as surly you already have a response object on the go.
On Apr 26, 8:11 am, Fabien
There is no response object 'on the go'. The controller action's
responsibility is to create the response.
t
On Wed, Apr 27, 2011 at 07:59, stickaforkinme sebdang...@gmail.com wrote:
Yeah worked that one out after posting on here... although prefered
the old renderText method of sfActions in