As previously mentioned, I have finished making a Model View Controller design pattern enforcer for PHP.
Firstly, I must start you off with a video.
Yes, the guy can’t sing … but he does a great overview of MVC.
So what is MVC and how will it help you? Based on the way it is structured, it pushes you in the right direction to creating highly maintainable code. Your code is separated into three main components: models, views and controllers.
- Models – The part of the application where all of the actual data processing should occur
- Views – The part of the website which is eventually emitted to the viewer
- Controllers – Acts as a liasion between the models and the views. This layer will pass any information required to the models back to it in a manner which is required by the model as well as tell the application what should be emitted for the front end (the views to display)
Why use this version of MVC over some of the more renown ones?
Easy … because it is extremely light and doesn’t require tons of additional files to run correctly and it works right out of the box. It is also fully documented and all of the documentation has been compiled and placed online at your finger tips just waiting for you to look through it.
How about fancy plugins and stuff?
There is already one out (a layout manager) and more are in progress.
So what do you get when you download the zipped Mini MVC file?
- The implementation of MVC
- Built-in use of my database class (see previous posts about it for more information)
- Sample controllers and views
Why not take the plunge and try it today?
I’ll be posting examples of how to use it shortly.
For more information about MVC, check out the Wikipedia article on it.
Please feel free to contact me if you have any question / comments / concerns / bugs that you find.