How do I create an advanced route with an ID that hits a controller method I am trying to create a page I can hit to update a record in the db, something I am used to doing in Laravel, but now have to do in Craft.

The controller method would look something like this:

public function updateUserRecordsTest($userId) {

    $user = craft()-&gt;users-&gt;getUserById($userId);
    // $data['status'] = 'asleep';
    // $user-&gt;update($data);

}


So I am trying to make a route in craft/config/routes.php like this

 route =&gt; user/update/{id} , controller =&gt; UsersController@updateUserRecordsTest;


Any suggestions on how to set this route up in Craft would be greatly appreciated.

*Update

So I will try to clear up what I am trying to do.

I need to update the users db when they pass classes.  This will most likely be a boolean, but may end up being an enum.  So what I would usually set up is a page with a controller method like below

 // sudo code

 public function passedThisClass($id) {
    $user = User::find($id);
    $data['passed'] = 1
    User::update($data);
 });


the route would look like

 // sudo code
 route::get('updatethisclass/{id} =&gt; UsersController@updateThisClass);


When I hit that page it updates the value from 0 to 1 flagging that they passed the class.
In your plugin's main class file you'd set the registerCpRoutes method to something like this:

public function registerCpRoutes()
{
    return array(
        'user/update/(?P&lt;userId&gt;\d+)' =&gt; array('action' =&gt; 'pluginHandleController/updateUserRecordsTest'
        ),
    );
}


The the method in your plugin's controller would look something like this:

public function actionUpdateUserRecordsTest(array $variables = array())


And $variables will be a collection of all of the named regex patterns captured in your route definition.