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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-20-2008, 02:41 AM
Junior Member
 
Join Date: Jun 2008
Posts: 2
Default underscore in action name

hi guys, just have a simple question that I can't seem to figure out.

i want to have a underscore in my action name like:
example.com/admin/manage_users

how do you do that? Thanks alot!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-20-2008, 07:34 PM
Member
 
Join Date: Jun 2008
Location: Florida
Posts: 88
Default

To use an underscore in the action name you need to:

1)Change the word delimiter used by ZF. The default is a dash. I have the following line of code in my bootstap to do this:
Code:
$frontController = Zend_Controller_Front::getInstance();
$dispatcher = $frontController->getDispatcher();
$dispatcher->setWordDelimiter(array('-', '.', '_'));
2)Camelcase your action method name:
Code:
public function manageUsersAction()
{
    // code goes here...
}
3)Place a dash in the name of your view script, in this case manage-users.phtml
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-21-2008, 02:23 AM
Junior Member
 
Join Date: Jun 2008
Posts: 2
Default

thanks! works great!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-21-2008, 02:46 AM
Member
 
Join Date: Jun 2008
Location: Florida
Posts: 88
Default

No Problem. I just started doing this recently, so the solution is fresh in my mind.
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 11:12 PM.