Hello Readers, this blog tutorial will explain how to use naming convention in CakePHP.
CakePHP have its own naming convention standards to be used during PHP application development.
If you want to create application using CakePHP, first you will need to create following files:
1. file to define the model,
2 file to define the controller,
3 files to represent output called presentation files or view files.
so, while creating model, controller & view files you have to follow CakePHP standards naming conventions
Table names corresponding to models are plural and underscored.
Controller classnames are plural, CamelCased, and end in Controller.
UsersController and PostsController are both examples of cakephp conventional names.
Model classnames are singular and CamelCased. User, Post are both examples of conventional model names.
For Example: Table Name-> "findnerds"
CakePHP naming conventions for model, view, and controller elements.
directory = app/models
filename = (same as the action name in the controller)
extension = .ctp (the filename extension)
directory = app/views/Findnerds