Naming Conventions in CakePHP

First, you should definitly read cakephp-conventions.html. This should clarify the basics.

Bottom line: Controllers are plural, their tables plural as well, the entity is singular.

Class names and URLs

It is recommended to use the "DashedRoute" (which is tbe default since 3.1 anyway).

With a basic example, we take a closer look at the naming scheme in URLs:


This URL includes already all basic elements: A controller "ExamplePages" in the "ExamplePlugin" with an action "actionName" as well as a passed param "passed-param" and query string "my-limit" with a value of "1".
If the controller had a model, its table class would be "ExamplePages" and the entity class "ExamplePage". The table would be "example_pages".

If you also use prefix routing (usually with the prefix "Admin") as well, this could be the URL to the the same controller in that plugin:


What you need to understand is, that the class names as well as the prefixes and namespaces like plugins are CamelCase, but the URL representation is always lowercase-dashed due to the "DashedRoute" class. Actions are camelBacked and also will get lowercase-dashed inside URLs.

Hands on

Try it out the different inflections with the Inflector.

Send your feedback or bugreport!