Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Naming Conventions in CakePHP- Model, View, and Controller

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 150
    Comment on it

    CakePHP model, view, and controller naming conventions

    If we have a database with table named users, then following standard Cake PHP naming conventions should be used:

    1. For Model

      filename  = User.php
      classname = User
      directory = app/models
    

    2. For Controller

      filename  = Userscontroller.php
      classname = UsersController
      directory = app/controllers
    

    Standard CakePHP controller actions/function() are:

    index(), add(), edit() ,view(), delete()
    

    3. For View

      filename  =index, add, edit, view (same name as the function name in the controller)
      extension = .ctp  (filename extension)
      directory = app/views/users
    

    View files corresponding to controller function with these names:

    index.ctp, add.ctp, edit.ctp, view.ctp, delete.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: