Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Naming convention in cakephp

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 309
    Comment on it

       In cakephp,  whenever you want to create an application, You have to create following three files :

    1. Model.
    2. Controller.
    3. View files.

    For all these files, there are some naming convention standard you must follow.

    MODEL NAMING CONVENTION :  Model Files are located at app/models folder

    • These should be  camel cased, and if there are more than more than one word used then, it should be separated by underscore.

    Example : User.php or User_login.php

    • Model file name are singular, usually this should be the database table name but in singular format.

    Example : User or UserLogin

     

    CONTROLLER NAMING CONVENTION : Controller Files are located at app/Controller folder.

    • Controller file names are plural and camel case, and filenames also end with ‘Controller.php’.

    Example : UsersController.php or UsersLoginController.php

     

    VIEW NAMING CONVENTION :

    • View files are located at /app/views and with a folder created with its respective controller name, if more than one word then separated by underscore.
    • View file names are function_name.ctp. Here, The function name is the name of the function you have defined in your appropriate Controller file.

     

    DATABASE TABLE AND FIELD NAMING CONVENTION :

    • Table name must be in lowercase & plural & If there are more than one word in the table name then words should be separated by underscore.

    Example : users, consultant_services, etc.

    • Field-Name should also be in lowercase and if more than one word then separated by underscore.

    Example : id, consultant_service_name

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: