V
V
vitalyg2016-03-01 10:24:50
PHP
vitalyg, 2016-03-01 10:24:50

Slim Framework how to pull data from post to $app?

I can't understand at all.
There is a code:

$app->post('/register/', function ($request, $response, $args) use ($app) {
var_dump($app);
return $this->view->render($response, 'registerduring .html', [
]);
})->setName('register');

var_dump($app); -> displays everything ...
but for example data like:
["bodyParsed":protected]=> array(4) { ["mail"]=> string(6) "yvy" ["password"]=> string(8) "yvy" ["name"]=> string (8) "yvvy" ["phone"]=> string(10) "yvy" }

I just can't pull it out, or rather I don't know which function is responsible for pulling out a piece from this agro-sized array...
---- I
figured it out. Everything. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2016-03-01
@misantron

docs.slimframework.com/request/variables
try learning how to google, it's a useful skill for a developer

Y
Yuri, 2016-03-01
@riky

$value = $app->request->post('var_name');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question