Do you'll want a Questions_Controller
(remember the _Controller
, it's important) like this:
// controllers/questions.php
class Questions_Controller extends Base_Controller {
public $restful = true;
public function get_choices($question_id, $choice_id)
{
// Use $question_id and $choice_id
}
}
And your route would look like controller@action
, so...
// routes.php
Route::get('questions/(:num)/choices/(:num)', 'questions@choices');
Routing to actions is covered at the end of Controller Routing, just before the section on CLI Route Testing. Wildcards work the same with actions as they do anonymous functions.