How to get parameters GET, POST, PUT in epiphany ?
ducbin opened this issue · comments
ducbin commented
Is there a standard method of epiphany to get the parameters GET, POST, PUT ? Thank you
Geoffery Miller commented
It's just PHP. There's no wrapper for get and post. The get parameters can be passed to a function via the route module when matching a route if you want, but there's not more than that, afaik.
Jaisen Mathai commented
@georules That's correct. There are two ways of passing in parameters.
The first is directly accessing $_GET
/$_POST
variables.
The latter is via the routes.
getRoute()->post('/foo/(.+).json', 'my_function');
function my_function($parameter) {
var_dump($parameter);
}
// POST /foo/bar.json
// will pass 'bar' in as $parameter to my_function