jmathai / epiphany

A micro PHP framework that's fast, easy, clean and RESTful. The framework does not do a lot of magic under the hood. It is, by design, very simple and very powerful.

Home Page:https://github.com/jmathai/epiphany

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get parameters GET, POST, PUT in epiphany ?

ducbin opened this issue · comments

Is there a standard method of epiphany to get the parameters GET, POST, PUT ? Thank you

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.

@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