How do naming conventions for controllers, actions, and views work in the Zend Framework?

The Zend Framework uses “camel-casing” for controller and action names. Controller names are specified using upper camel-case and are suffixed with the word Controller (examples: IndexController, StaticContentController, FunkyChickenController), while action names are specified using lower camel-case and suffixed with the word Action (examples: indexAction, displayPostAction, redButtonAction). For modules other than the “default” module, controller names must be additionally prefixed with the module name (examples: News_IndexController,Catalog_EntryController).

View scripts take their name from the corresponding controller and action. Typically, the view script is stored in a directory corresponding to the controller name (without the Controller suffix), in a file whose name corresponds to the action name (without the Action suffix). Therefore, the view script for the clickAction in the ExampleController would be located at /views/scripts/example/click.phtml.

Multiple words in the controller or action name are represented by hyphens or periods in the corresponding view script file path. Therefore, the view script for the displayItemAction in the ShoppingCartController would be located at


To prevent name collisions, the Zend Framework also allows the use of custom namespaces, which can be prefixed to object or class names. These namespaces can be registered with the Zend Framework autoloader, to have the corresponding definitions automatically loaded on demand, as needed.

Leave a Reply

Your email address will not be published. Required fields are marked *

Prove me that you are not a robot :) * Time limit is exhausted. Please reload the CAPTCHA.