MVC rule

1. mySQL tables will always be lowercase and plural e.g. posts, books
2. Models will always be singular and first letter capital e.g. Post, Book
3. Controllers will always have “Controller” appended to them. e.g. PostController, BookController
4. Views will have plural name followed by action name as the file. e.g. posts/view.php, books/buy.php

For Example :

1. models process

models => post.php

class Post extends Model {


2. controllers 

controllers  = > postscontroller.php

class PostsController extends Controller {

    function view($id null,$name null,$phone null) {

       // view / display code here

    function viewall() {

      // view all posts

add() {


 // add post code here

delete($id null) {

        delete post code here


3. views = > posts =>



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s