Search code examples
kohana

Kohana $this->request->param('id') - what is it used for - GET or POST


I'm new to Kohana. It is used this: $this->request->param('id') when should I use it - it means POST or GET? When could I use it - how to pass parameters when they are $_POST or $_GET data? Thanks!


Solution

  • Both POST and GET in fact are not true. For POST you will use:

    $this->request->post();
    

    For GET you will use:

    $this->request->query(); 
    

    That what you are asking:

    $this->request->param('id')
    

    is used if you want to get route id parameter.

    Read about routes here: https://kohanaframework.org/3.3/guide/kohana/routing