On Mon, Jul 9, 2012 at 8:34 AM, Chris <[email protected]> wrote:
> Hi!
> I want on my website create rule, when I access:
>
> address/username the default page with user is shown. I created:
> Router::connect('/*', array('controller' => 'users', 'action' => 'view'));
>
> But then I cannot link any other controllers or actions.

Yes, of course. This route matches anything and everything. So, for
starters, you would have to define routes for all your other
controllers and actions and place them before the one for Users::view.
One way you could simplify this would be to include something in the
URL before the user's name like so:

www.domain.etc/users/some-user-name

This would allow you to target only URLs which begin with "/users/" so
already things become much easier.

If you don't want to do that then the next  problem is to determine if
whatever the URL contains is a valid username. For that you should
extend CakeRoute:

http://mark-story.com/posts/view/using-custom-route-classes-in-cakephp/

-- 
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