Answers for "symfony get post params"


symfony get post params

use Symfony\Component\HttpFoundation\Request;

$request = Request::createFromGlobals();

// the URI being requested (e.g. /about) minus any query parameters

// retrieves $_GET and $_POST variables respectively
$request->request->get('category', 'default category');

// retrieves $_SERVER variables

// retrieves an instance of UploadedFile identified by "attachment"

// retrieves a $_COOKIE value

// retrieves an HTTP request header, with normalized, lowercase keys

$request->getMethod();    // e.g. GET, POST, PUT, DELETE or HEAD
$request->getLanguages(); // an array of languages the client accepts
Posted by: Guest on July-16-2020

Browse Popular Code Answers by Language