在KOHANA框架中检索GET参数

use*_*167 1 php routes get kohana

我的网址如http://MYDOMAIN.com/cron/reports/test?code=f463529c1b75f4d868.我需要检索代码(f463529c1b75f4d868).我该怎么办?(我在Kohana工作)我有这样的路线:

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

在我写的控制器报告中:

var_dump(Request::instance()->param('code'));
Run Code Online (Sandbox Code Playgroud)

我的结果是NULL.怎么了?

Vin*_* V. 6

通常查询字符串应该是这样的:

$code = $this->request->query('code');
Run Code Online (Sandbox Code Playgroud)