I agree that in most cases you will do a simple
$this->get('request')->get('param')
call but this has two disadvantages:
1. It's slower (it has to check all Symfony\Component\HttpFoundation\Request
ParameterBags to see if the parameter is set in GET, PATH, POST, COOKIE
2. Name collisions:
$this->get('request')->request->get('id') will return null if the id
parameter is not found in POST but
$this->get('request')->get('id') will return the value of the id parameter
from the query string (GET)
regards,
Catalin
On Tue, Apr 5, 2011 at 4:07 AM, Vladimir Chernyshev <[email protected]>wrote:
> What about PUT & DELETE requests?
>
> I think, in most cases it doesn't matter where we get parameters from.
> Theese are parameters of request to symfony. What method, what
> (form)encoding, may be what transport protocol - I prefer don't think
> about this when I get request in controller if I know this request
> pass through routing and others framework's components and core.
>
> 2011/4/4 Catalin Costache <[email protected]>:
> > Hi,
> >
> > I will like to propose a backward incompatible change to the naming of
> the
> > public $request ParameterBag
> > from the Symfony\Component\HttpFoundation\Request
> >
> > In my opinion it should be called $post instead of $request because:
> > 1. is obvious what part of the request is handled
> > 2. the current naming is deceiving (I expect to find GET, COOKIE or other
> > types of request parameters in this ParameterBag)
> > 3. finally but less important, in a controller you have to write
> > $this->get('request')->request->get('parameter') instead of
> > $this->get('request')->post->get('parameter') - a superficial argument, I
> > know.
> >
> > The same arguments stand also for the $query bag, but that makes more
> sense
> >
> > What do you think?
> > I will make a pull request if you think that this is ok.
> >
> > Thanks
> >
> > --
> > 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
> >
>
> --
> 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
>
--
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