Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Discussion on naming conventions in CakePHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 610
    Comment on it

    Hi Reader's,
    Welcome to FindNerd,today we are going to discuss naming conventions in CakePHP.

    When implementing a web application in CakePHP, we have to use naming conventions for making any model name and table name etc very carefully.

    Firstly when developing CakePHP project we need to manage all folders in a conventions way.

    For better understanding see below steps.

     

    1- If we are creating a controller then our folder should be like below

     Controller
     Dir- app/Controller

     

    2- If we are creating a model then our folder should be like below.

    Model
    Dir- app/Model

     

    3- If we are creating a view then our folder should be like below

     View
     Dir-app/View

    When we go for creating a database then we should follow below standards.

     

    Note: Table Name must be lowercase and Plural

    users, user_tables

     

    If want to create a "Controller" then Controller file names should be in plural and camelcase and filenames must end with ‘Controller.php’. So our Controller file name will like below.

    UsersController.php or UsertablesController.php 

     

    If want to create a model then  Model class name should be in singular.
    So our model file name will be like below:

    User,UserTable

     

    If want to create a view file then it should end with function_name.ctp
    So our model file name will be like below:

    user_registration.ctp,uesr_edit.ctp

     

 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: