I am working with legacy code written in PHP 5.2.6 with Zend Framework 1.5.3 on CentOS 5.5
There is code as such
url:"./sales/getAlerts/?bypass=1"
The view is named getalerts.phtml
Controller function is named getAlertsAction
Code works fine on existing server, but when I try moving it to a new server the code fails stating that …’Action “getalerts” does not exist…
If I change the lines mentioned above to make the [A] in Alerts lower case the code works.
I’ve copied over php.ini, httpd.conf, and .htaccess. Not sure what else could allow case insensitive mapping to occur.
What is it that allows url-routing to be case insensitive?
You should be able to use any URLs you want in your routes… I’m guessing you are using the default /:controller/:action/* route? If so, create custom ones to point to the lower-case actions that you’ve defined.
The confusion lies in mapping your route parameters to your actual controllers/actions/modules. Each ‘word’ is broken down into camelCase for the controller action, but everywhere else you have to use the hyphen to separate words.
test = testAction = test.phtml
test-something = testSomethingAction = test-something.phtml
You should be able to modify this behaviour. Check out Zend_Controller_Dispatch_Abstract::formatActionName(). However, ideally, you’d just want to modify your route.