first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

Zend Framework PROBLEM: Configured Routes with Camel-Casing Throw ‘Action Not Found’ Exceptions

In versions of the Zend Framework greater than 1.0.3, case sensitivity matters for Controller actions specified in configuration files (including XML configuration files). This means that the following declared route will throw an exception because the document Controller does not have a public method written as documentcode:

<routes>
    <documentByCode>
        <type>Zend_Controller_Router_Route_Regex</type>
        <route>document/code/(\\w+)</route>
        <defaults>
            <controller>document</controller>
            <action>documentCode</action>
        </defaults>
        <map>
            <documentCode>1</documentCode>
        </map>
    </documentByCode>
</routes>

This is a correct form:

<routes>
    <documentByCode>
        <type>Zend_Controller_Router_Route_Regex</type>
        <route>document/code/(\\w+)</route>
        <defaults>
            <controller>document</controller>
            <action>document-code</action>
        </defaults>
        <map>
            <documentCode>1</documentCode>
        </map>
    </documentByCode>
</routes>

Now the Framework will look for documentCode with the case sensitivity and find it without exceptions. For more information, see 10.13.3. “Migrating from 1.0.x to 1.5.0 or Newer”:

http://framework.zend.com/manual/en/zend.controller.migration.html

mod date: 2009-03-21T17:07:15.000Z