You have to define it in urlmanager like so for e.g.:
'rules' => array(
'api/user/<id:\d+>/<mode:\w+>' => 'api/user/someaction',
),
You can then go to http://www.mywebsite.com/index.php/api/user/15/profile and the call goes to api module, user controller, action someaction and passes the $_GET variables "id" and "mode" to it.
actionSomeaction($id, $mode)
{
var_dump($id, $mode);
}
EDIT: to make it dynamic use this:
'rules' => array(
'<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>/<mode:\w+>' => '<module>/<controller>/<action>',
),
However I would not make everything dynamic since you usually only want to pass the params id
and mode
to user/someaction.