Hello, 

we already had the same question a while ago in the mailing list. Assuming
you have a controller named IndexController with a action called
doSomthingHelpfulAction you have to access
http://host/index/do-something-helpful/ to get the desired result. The
request to the uri /index/so-something-helpful/ will be dispatched to your
IndexController::doSomethingHelpfulAction. If you'd request
/index/doSomethingHelpful/ the dispatcher would simply lowercase the whole
uri and map it to the method IndexController::dosomethinghelpful.

Right now I can't find the part in the documentation that describes this
behavior but I'm sure you'll be able to find it with a little effort :)

Best regards,
Daniel

-----Ursprüngliche Nachricht-----
Von: Hoopes [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 17. März 2008 22:45
An: [email protected]
Betreff: [fw-general] Normalizing action function names


First off, congratulations on the 1.5 release, things look awesome,
especially all the specialized modules. 

We've been using the framework for a while now, and absolutely love it. It's
saved us a great deal of time and money. So, we have a decent amount of code
written for it. We recently installed the 1.5 release on our development
servers, and realized all requests to camelCased actions were returning a
404. I read the documentation, and found in 7.2 (Controller Basics):

[Note]  CamelCasedNamingConventions
 Since humans are notoriously inconsistent at maintaining case sensitivity
when typing links, Zend Framework actually normalizes path information to
lowercase. This, of course, will affect how you name your controller and
actions... or refer to them in links.

I...would rather not do this. Is there a way to easily turn this off? I have
quite a few action functions, with some long, descriptive function names,
and making them all lower case makes
somelongdescriptiveactionnameithoughtupAction() harder to read. For the time
being, I just put 

return $unformatted.'Action';

in Zend_Controller_Dispatch_Abstract::formatActionName, but would a feature
request to be able to control that behavior be reasonable? If not, is there
a way to keep my camelCased function names using some type of smart router?

Thanks very much,
- hoopes
-- 
View this message in context:
http://www.nabble.com/Normalizing-action-function-names-tp16104772s16154p161
04772.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Reply via email to