There’s a lot of talk these days about design patterns. The most talked about pattern in the realm of web development seems to be the MVC pattern, or the Model-View-Controller. It is this pattern that many of the most popular frameworks are built around. Frameworks like symfony, CakePHP and CodeIgniter enforce this pattern and offer tools to help make using it a breeze. Ruby’s famous Rails framework and Perl’s Catalyst also make use of the MVC pattern. So what is the big deal? Should you care? In this post I’m going to briefly try and explain the MVC pattern, why you should use it, and how. Read the rest of this entry »

Yesterday I spent 6 or 7 hours working with the symfony framework. After investigating several other frameworks available, like CakePHP and CodeIgniter, I settled down to work with symfony and I’m glad I did. It has a pretty big learning curve, but the free book is an invaluable resource (I’m actually thinking of buying the printed copy). The framework itself is great, and is built up of some excellent parts like Propel for ORM and Creole for database abstraction. Even if you don’t use symfony, check out those two open-source libraries, they are excellent.

Yesterday’s time was spent both learning the framework and creating the upcoming Outershift website. In 6 hours I learned much and completed a good chunk of the back-end. Considering I started from scratch, I am very pleased with how quickly the project has progressed. So, check out the symfony framework for yourself!

Example PaginationPagination refers to splitting up a large result set into multiple pages. Probably the most recognized use of pagination is that displayed by Google when you perform a search. As long as there have been applications, there has been a need to paginate. Everything from long documents to search results, it’s something almost every app you use has in common. Considering just how common pagination is, it’s the one thing that seems to trip up many amateur programmers. Today I’m going to go over how to create a simple pagination feature in PHP with data collected from a MySQL database. You can download the sources and example database at the end of the post. Read the rest of this entry »