PHP Framework

In an effort to learn how to properly design PHP applications I made this page without help from any frameworks, templating engines or other third party tools. I have always found the language to be a messy language that didn't really encourage well designed applications and this has led to a couple of websites which were far from pretty but which got the work done. I get the impression that I'm not alone in feeling this way about PHP, though.

To make order of the chaos I have made something of a framework myself, which makes it quite easy for me to extend the website. I figured that if anyone else would find the code useful they might as well benefit from my work. This calls for a bit of extra work as the framework code has not been my main focus but just sort of appeared over time. Currently, I'm in the process of cleaning up the code, redesigning it and then making it publicly available. As the different parts of the code gets cleaned up I'll be presenting the main design points and usage patterns in a number of blog posts.

Framework Bits and Bobs

This list contains the parts of the framework which have been cleaned up published, each item pointing to a blog post giving an overview of how it works.

Framework Design

The framework is designed around the MVC pattern, such that the user defines a controller for each url, along with its associated model and view representation(s). I have attempted to automate as much of the process as possible such that you only have to create the proper controllers, models and views, and the framework will handle the dispatching of page requests and instantiations of controllers.

I must admit that my experiences with application design is limited on the area of the stateless web model and are mostly based on experimentation and inspiration from other application types. Thus, I make no claim that this is the best way to develop a web application but it has served me well enough.

Download

As I cover more and more aspects of the code, the cleaned up parts are included in a downloadable package. The content might vary from the versions described in the blog posts as I continually improve the design and refactor the code.