Recently I browsed symfony2 api docs and here is what i've found in documentation for Request's get method:
Avoid using this method in controllers:
- slow
- prefer to get from a "named" source
So what is the "named" source
that I should use instead of get
method?
"named" source would be appropriate parameter bag:
$request->query
for GET parameters$request->attributes
for request attributes (parsed from PATH_INFO)$request->request
for POST parametersget
method simply goes through all of them until it finds a parameter by name. Therefore its slow. See the implementation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With