Jump to content

My own MVC framework


johnsmith153

Recommended Posts

I am creating a new site and want to ensure it is done properly using MVC architecture / my own framework.

 

I don't want to use a PHP framework, I want to do it myself.

 

The site allows uploading and viewing of photos and videos.

 

Should I?

 

(option 1) Have 3 access points:

add.php (addding photos / videos)

view.php (viewing photos / videos)

admin.php (all admin stuff)

 

Each of the above 3 are controller pages, using class autoload to load relevant classes and then displaying one of the following pages as the content:

 

(these 2 only for add.php)

addphotos.php

addvideos.php

 

(only for view.php)

viewphotos.php

viewvideos.php

 

(admin.php)

admindelete.php

adminchangepassword.php

 

etc. (all called from the controller page)

 

(option 2) index.php is the only access point which decides which controller code (using ?page= etc.) to access and the rest is similar to (1)

 

 

What is the best method and do I have the MVC architecture thing understood?

 

Most places tell you to do (2) but I just prefer (1) (there are only 3 access pages)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.