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 wrote:
> Le 12/05/2011 14:04, Javier Garcia a crit :
>
> > On May 12, 1:
Le 12/05/2011 14:04, Javier Garcia a écrit :
On May 12, 1:51 pm, Christophe COEVOET 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
On May 12, 1:51 pm, Christophe COEVOET 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 example, you kno
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 th
> > On Apr 26, 8:11 am, Fabien Potencier > project.com> wrote:
>
> >> return new Response(json_encode($data));
>
> >> Fabien
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:
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 wrote:
> Yeah worked that one out after posting on here... although prefered
> the old renderText method of sfActions in sf 1.x as this was
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 Potenc