Reputation: 1963
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
Reputation: 1963
The easiest way to resolve this problem is global array $_SERVER!
Upvotes: -2
Reputation: 3143
Normally query strings should be available like this:
$code = $this->request->query('code');
Upvotes: 6