Jump to content

Creating an MVC site


Recommended Posts

I have created an MVC site before as part of my degree and didn't like it, but now I see its actually quite a powerful concept.  Despite this, I'm not actually sure how to proceed.  So far in my design I have the following classes:

 

- DBGateway:  Connects to the MySQL database, this is the only class with SQL specific functions.  Its functions receive the SQL query syntax and then generates exceptions or returns the data (in the form of an instance of DBResult).

- DBResult:  This is a special object that houses the results in various arrays etc from the database (through DBGateway).

- user:  Holds all information regarding user, including output of HTML when appropriate function called.

- product:  Holds all information regarding product, including output of HTML when appropriate function called.

 

Additional classes include shoppingItem and shoppingCart, although these won't be implemented yet.  I recall in my degree project I had some form of controller class.  I'm not quite sure how to use this though.  Any ideas what a controller class could be for?

Link to comment
https://forums.phpfreaks.com/topic/107813-creating-an-mvc-site/
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.