symfony get request in php index code example
Example 1: symfony get post params
use Symfony\Component\HttpFoundation\Request;
$request = Request::createFromGlobals();
$request->getPathInfo();
$request->query->get('id');
$request->request->get('category', 'default category');
$request->server->get('HTTP_HOST');
$request->files->get('attachment');
$request->cookies->get('PHPSESSID');
$request->headers->get('host');
$request->headers->get('content-type');
$request->getMethod();
$request->getLanguages();
Example 2: symfony get query param
$request->query->get('paramName')