Answer the question
In order to leave comments, you need to log in
POST and GET parameters in framework at the same time?
I can’t understand how to get POST parameters, but how GET, if both are used at the same time.
I figured out only with the router, for both GET and POST to work, $app-> match () is needed at the same time;
It seems that frameworks should be so convenient, but here is a dead end.
Not really, you have to use $_GET and $_POST.
$app->post('/', function (Silex\Application $app) {
$request = $app['request'];
$ajax = $request->get('param'); //Это POST
});
$app->match('/', function (Silex\Application $app) {
$request = $app['request'];
$ajax = $request->get('param'); //Это GET
});
$app->match('/', function (Silex\Application $app) {
$request = $app['request'];
$ajax = $request->get('param'); //Это GET или POST?
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question