Extending the V in MVC – revisited
This post is an revised version of 'Extending the V in MVC on the web' of November 9, 2008.
When I first started working with the MVC method it was with my own framework. After noticing that maintaining my own framework would be very time-comsuming I embarked on the search for a free, fast and widely supported PHP web framework. The one I found that time was 'CodeIgniter'.
After working on different projects I noticed that most websites present the same data to the visitor in several different formats. Think of RSS/Atom for blog posts for use in an RSS reader together with the (x)html versions.
While essentially providing the same data to the visitor the programmer of the website has to put sizable amount of work to add little extra functionality in the form of an RSS feed. Repeating a lod of code for input validation, data retrieval from the database and creating extra routes into the application. As you can imagine this could grow into a tedious job.
I'll be describing techniques known and in use today, but reinvented each time again as a (new) developer starts working on an web application. Here we'll be giving them name and be describing them.
Doctrine meets CodeIgniter
Anyone who has made websites in the past has encountered it. The endless bugging typing of SQL queries, always doing the same over and over again. This struggle is lightened by the use of frameworks or even complete CM-Systems. However, SQL query writing is still often needed.
To counter this (and other annoying pestering little details mongering), Object Relational Mappers were invented. Doctrine is a PHP implementation of the RoR ORM. And now it's quite easy to merge CodeIgniter and Doctrine into one package.
Just follow the readme and continue your adventure.