On Sat, Oct 25, 2008 at 3:09 PM, Kris Wallsmith <
[EMAIL PROTECTED]> wrote:

> I've proposed the addition of two public method to the request classes in a
> Trac ticket, and am posting here for feedback from the community. Please
> respond with any thoughts.
> http://trac.symfony-project.org/ticket/4746
>
> From the ticket...
>
> I've attached a patch for review. This patch adds the following method to
> the request classes:
> • sfRequest::getContent()
>  • sfWebRequest::getContentType($trim = true)
>


+1 to this idea.  I would have found this very useful on a present project.
What I did was to subclass sfWebRequest in order to get similar
functionality.

What might be useful here is automatic parsing of JSON input, so that
similar/identical code can be used for handling JSON input as POST input.
For example, I have an app which posts some JSON similar to this:

order: {
  id: 1,
  customer_id: 5,
  delivery_date: "Nov 08, 2008",
}

It would be good if I could do $request->getParameter('order') and retrieve
an array of values that would be exactly the same as an array of values for
an 'Order' model as submitted by the standard auto-generated form.  This
would enable significant re-use of code for validation of input data.

If this seems like a good idea then I can produce some code for this in the
next few days.

Regards,

Rob Knight

--~--~---------~--~----~------------~-------~--~----~
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