Rolling Your Own MVC Framework - Starting-Point for Any PHP Application

Michael Girouard's Blog

Over the next couple of articles, I'll be walking you through the process of developing a simple MVC framework that you can use as a starting point for almost any PHP application that needs to be developed.

Furthermore this framework won't be like any other framework you've seen: it's going to be small enough to not obstruct the real development, elegant enough to make it a pleasure to work on in the future, and scalable enough to be useful in the development of applications of any size.

How? By keeping things simple and resisting the urge to add tons of stupid features. Remember, it’s just a framework. Save the real coding for the application.

The Ground Rules

Before we dive into the deep end, let’s get a few things straight. Everyone has their own way of interpreting the concepts I will be presenting so before anyone draws any premature conclusions, I’m going to lay it all out in the open.

In no particular order:

The Feature Set

Even though the goal of this framework is to be lightweight, it still will need to have a reasonable set of features to make it worth using. The following list are things that I think are requirements in any modern PHP framework:

So why reinvent the wheel?

Because you can. Because you will learn a great deal. Because all other frameworks are great for getting an application off the ground, but come with a lot of extra baggage that you simply don’t need.

The reality is simple: frameworks aren’t that big of a deal. Just because is big, bulky, and bad ass doesn’t mean that you can’t make something just as good… even better since it will be your framework.

[The second part of this series can be found here.]
© 2008 SYS-CON Media