Re: Version 1.3 Routing Vanity URLs

2010-05-05 Thread mark_story
Perhaps

Router::connect('/:username/*', array('controller'='users',
'action'=view'), array('username' = (?!admin|users|posts)'));
Router::connect('/:username/:controller/:action/*',
array('controller'='users', 'action'='view'), array('username' = (?!
admin|users|posts)'));

Could do the trick?

-Mark

On May 4, 3:58 pm, Brian Watson dev.web.l...@gmail.com wrote:
 Did anyone find a solution to this as I have the exact same problem.

 Thanks





 - Original Message -
 From: CharlesTMunger ryan.dy...@gmail.com
 To: CakePHP cake-php@googlegroups.com
 Sent: Monday, May 03, 2010 2:01 AM
 Subject: Version 1.3 Routing  Vanity URLs

  In my 1.2x app I have vanity URLs from the base.  I.e., a user named
  munger can have his page located at:

 www.mysite.com/munger

  Accomplishing this was pretty straightforward -- in my routes.php I
  had this line at the end:

  Router::connect('(?!admin|users|posts)(.*)', array('controller'='users',
  'action'='view'));

  Then, in the view method of my users_controller, I simply did a find
  based on user name. I tried upgrading to 1.3 and this doesn't work
  anymore  -- I assume it has something to do with not supporting regex
  anymore.

  So -- any ideas on how to go about accomplishing this in 1.3?

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group
  athttp://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Version 1.3 Routing Vanity URLs

2010-05-04 Thread Brian Watson

Did anyone find a solution to this as I have the exact same problem.

Thanks
- Original Message - 
From: CharlesTMunger ryan.dy...@gmail.com

To: CakePHP cake-php@googlegroups.com
Sent: Monday, May 03, 2010 2:01 AM
Subject: Version 1.3 Routing  Vanity URLs



In my 1.2x app I have vanity URLs from the base.  I.e., a user named
munger can have his page located at:

www.mysite.com/munger

Accomplishing this was pretty straightforward -- in my routes.php I
had this line at the end:

Router::connect('(?!admin|users|posts)(.*)', array('controller'='users', 
'action'='view'));


Then, in the view method of my users_controller, I simply did a find
based on user name. I tried upgrading to 1.3 and this doesn't work
anymore  -- I assume it has something to do with not supporting regex
anymore.

So -- any ideas on how to go about accomplishing this in 1.3?

Check out the new CakePHP Questions site http://cakeqs.org and help others 
with their CakePHP related questions.


You received this message because you are subscribed to the Google Groups 
CakePHP group.

To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group 
at http://groups.google.com/group/cake-php?hl=en 


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Version 1.3 Routing Vanity URLs

2010-05-02 Thread CharlesTMunger
In my 1.2x app I have vanity URLs from the base.  I.e., a user named
munger can have his page located at:

www.mysite.com/munger

Accomplishing this was pretty straightforward -- in my routes.php I
had this line at the end:

 Router::connect('(?!admin|users|posts)(.*)', array('controller'='users', 
 'action'='view'));

Then, in the view method of my users_controller, I simply did a find
based on user name. I tried upgrading to 1.3 and this doesn't work
anymore  -- I assume it has something to do with not supporting regex
anymore.

So -- any ideas on how to go about accomplishing this in 1.3?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en