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
https://forums.phpfreaks.com/topic/207904-my-own-mvc-framework/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.