how can I get post data in Kohana 3 controller?

shershen picture shershen · Mar 1, 2011 · Viewed 15.1k times · Source

I've got a view with a form, so when user submits it - could anyone give me a link or a simple example of code Documentation and tutorials for Kohana 3 are so poor against CI .

Answer

zombor picture zombor · Mar 2, 2011

In Kohana 3.1 you should use Request->post():

Request::current()->post()

or if in your controller:

$this->request->post()

Since Kohana is HMVC, you can call sub-requests with dedicated post data, so using the superglobal $_POST is discouraged, since it's not unique to the request.