Kohana 3 - How do I make the Default Route pass arguments to the Controller's Action?
- by John Himmelman
My controller action requires a parameter, but I can't get KO3's router to pass this parameter in the Default route. This sort of thing works with other routes. Here is an example to clarify...
In bootstrap.php...
Route::set('default', '(<controller>(/<action>(/<the_required_param>)))')
->defaults(array(
'controller' => 'DefaultController',
'action' => 'index',
'the_required_param' => 'some_default_value',
));
In controller file...
class DefaultController extends Controller
{
public function index($the_required_param)
{
echo 'value: ' . $the_required_param;
}
}