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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-04-2008, 04:00 PM
Junior Member
 
Join Date: May 2008
Posts: 5
Default Omit parameter name in URL

May i omit parameter name in URL in zend framework?

for example, may i use
http://127.0.0.1/user/delete/?23 or http://127.0.0.1/user/delete/23
instead of
http://127.0.0.1/user/delete/id/23 ?

Of course, in the case, there is noly one parameter for this action.
I would like to hide the parameter name in URL.

Is that possible? thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-07-2008, 04:13 AM
Junior Member
 
Join Date: May 2008
Posts: 5
Default

i found the answer by myself. it should like the following:

PHP Code:
    /* added by cheyo 2008-06-06 above */
    
$router $frontController->getRouter(); // returns a rewrite router by default
    
$route = new Zend_Controller_Router_Route_Regex(
        
'([^/]+)/([^/]+)/(\d+)',
        
null/* this line could be: array('module' => 'default') */
        
array(
            
=> 'controller',
            
=> 'action',
            
=> 'id'
        
)
    );
    
$router->addRoute('archive'$route);    
    
/* added by cheyo 2008-06-06 end */ 
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:18 AM.