user1440167
user1440167

Reputation: 1963

Retrieve GET params in KOHANA framework

My url such as http://MYDOMAIN.com/cron/reports/test?code=f463529c1b75f4d868 . And I need retrieve code (f463529c1b75f4d868) . What should I do? (I'm working in Kohana) I have route such this:

Route::set('cron_defaults', 'cron/<controller>(/<action>(?code=<code>))')
        ->defaults(array(
    'directory' => 'cron',
    'controller' => 'reports',
    'action' => 'test',
));

And in the controller reports I've written :

var_dump(Request::instance()->param('code'));

And I have NULL as result. What is wrong?

Upvotes: 1

Views: 6681

Answers (2)

user1440167
user1440167

Reputation: 1963

The easiest way to resolve this problem is global array $_SERVER!

Upvotes: -2

Vince V.
Vince V.

Reputation: 3143

Normally query strings should be available like this:

$code = $this->request->query('code');

Upvotes: 6

Related Questions