php - How to access POST parameters in the Phalcon Micro framework -
i'm trying out phalcon micro framework. tutorial on page mentions following way access request data:
$app->request->getjsonrawbody();
i want access standard post parameters since don't see in tutorial, tried passing json in request body. result got 500 error , in log:
php fatal error: call member function getjsonrawbody() on non-object in /users/tom/dropbox/code/microphalcon/index.php on line 8 php stack trace: php 1. {main}() /users/tom/dropbox/code/microphalcon/index.php:0 php 2. phalcon\mvc\micro->handle() /users/tom/dropbox/code/microphalcon/index.php:44 php 3. {closure:/users/tom/dropbox/code/microphalcon/index.php:6-11}() /users/tom/dropbox/code/microphalcon/index.php:44
google has not helped.
all want access post parameters. how can that?
your $app
ins't object...are using closure correctly?
//adds new robot $app->post('/api/robots', function() use ($app) { $robot = $app->request->getjsonrawbody(); // ...
pay attention on use
statement!
Comments
Post a Comment