In your users controller (cake 2.0):
function view($id = null) {     if (!empty($this->request-
>params['userid'])) {
                $id = $this->request->params['userid']; }
        ...}
In your routes.php:Router::connect('/:userid',  array('controller' =>
'users', 'action' => 'view'),   array('userid' => '[0-9]+'));

If userid can be username (eg: contain non-numbers) you will have to
modify "array('userid' => '[0-9]+')" to account for that
On Nov 13, 2:02 pm, Sushil Gupta <[email protected]> wrote:
> Hi! I'm a CakePhp beginner. In my app, users can view their details 
> from,http://myapp/users/view/userid. But I what I want is,http://myapp/userid.
> How do I do this?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to