I’m using cakephp 2.9.1
my app have a users and signup
when i want to view any user profile i found the link : xx.com/users/view/ [id]
and the [id] reefer to the user id in the database
i created another column in the db so whenever some one signup will choose unique username
i want to show the username in the link to the profile
to be xx.com/users/view/[username]
i searched a lot and did not find the line that directs to view/id
the final generated html file is concetaned together from a few (or a lot of) different template files.
By default all controllers renders /src/Template/Layout/default.ctp
In this file you have a <?= $this->fetch('content') ?> line what actually calls the corresponding template file.
By default the url /users/view/XX will be handled by /src/Controller/UsersController.php file’s view method.
If you baked your controller this method requires to pass a user id, and it will find the appropiate user from the database and make the result available for the view (template). If you want to use username instead of id, you should change this method a little bit.
When the controller finished its work it will call /src/Template/Users/view.ctp to display the user.
Your layout and your template files can include other elements (from /src/Template/Element) and these will be also included in the generated HTML document.