Question

I have an anchor in view:

echo HTML::anchor("admin/supm_find?page=".($page+1).'&tselected='.$selected, "Next");

Wenn, i ckick on anchor tag, that's call "admin" contorller with "supm_find" action and "page" and "selected" params.

In controller:

$selected=$this->request->post('selected');
$page=$this->request->post('page');

but, the both variables value is NULL! What's wrong? In error message i see this :

 SYSPATH\classes\kohana\request\client\internal.php [ 116 ] » ReflectionMethod->invoke(arguments) 

        protected _get => array(2) (
        "page" => string(1) "2"
        "selected" => string(7) "Wien"

How to get these values?

Was it helpful?

Solution

This should work:

$selected=$this->request->query('selected');
$page=$this->request->query('page');

$this->request->post() operate on $_POST array,

$this->request->query() operate on $_GET array

$this->request->param() operate on kohana route params

You can read more here: http://kohanaframework.org/3.1/guide/api/Request

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top