Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-14-2008, 03:27 AM
Junior Member
 
Join Date: May 2008
Posts: 5
Default Router for controller alias

Hi everyone.

I need a router to add a alias to my controller named 'user' as 'my'. and also,
when the url only contains param value(digits) but not param name, we add a default param name as 'id'.

it means that:
/user/changepassword/32 should be reroute to /user/changepassword/id/32
and
/my/changeinfo/32 should be reroute to /user/changeinfo/id/32

I try following code, but it tells me "userInvalid controller specified (my)"

PHP Code:
$route = new Zend_Controller_Router_Route_Regex('/my/([^/]+)/(\d+)',null, array('controller' => 'user'=> 'action'=> 'id'));
$router->addRoute('my',$route); 
need your help, thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:09 AM.