cakephp中的动态用户友好URL

I know how to make user friendly url in cakephp using route. And I also know how to make url rewriting in .htaccess. But I have a requirement where I have to use username and its id in encrypted to its custom url. In the controller method I am passing only id as its argument. And based on that id it is showing me the profile page of that user.

I have url like this.

www.example.com/profile/<encrypted_id>

But I want like this

  www.example.com/<member name associate to that id>/<encrypted_id>

Everyday 100 of user are signing up so I have to make it dynamic. Is there any suggestion or way to do it.

Create a route

Router::connect('/:username/*', array('controller' => '...', 'action' => '...'), array('pass' => array('username'))));

read the value in the controller:

function foobar($id = null) {
    debug($this->request->username);
    debug($id);
}