For importing Request Class use following statement
use SymfonyComponentHttpFoundationRequest;
Following statement creates object of class “Request”
$request = Request::createFromGlobals();
// the URI being requested (e.g. /about) minus any query parameters
Every Index of $_SERVER global variable can be accessed using Request object with using get method
so for example to get $_SERVER['PATH_INFO'] using Request Object use following statement.
$request->getPathInfo();
// retrieve GET and POST variables respectively
$request->query->get(‘foo’);
$request->request->get(‘bar’);
// retrieves an instance of UploadedFile identified by foo
$request->files->get(‘foo’);
$request->getMethod(); // GET, POST, PUT, DELETE, HEAD
$request->getLanguages(); // an array of languages the client accepts
List of functions available in Request class can be accessed via following link
http://api.symfony.com/2.0/Symfony/Component/HttpFoundation/Request.html
December 30th, 2011 on 7:57 PM
Bart: Take him away boys.
Cheif Wiggum:I’m the cheif around here. Bake him away toys.
Lou: What did you say cheif?
Cheif Wiggum: Do what the kid said.