Designing for CodeIgniter

Last week we launched our very own redesigned website. Early in the design process we discussed options for handling content management, and as the launch date neared, we refined our requirements.

Basically, the site would need:

  1. Dynamic portfolio pieces, with the top-most piece published automatically to the home page
  2. Static (X)HTML for the about and contact pages
  3. A contact form
  4. A blog

Initially we considered Drupal, a feature-rich open-source CMS we've used in the past with great results. For this case, Drupal seemed too feature rich.

We Opted to Build Instead.

Before the redesign I had a small amount of experience using CodeIgniter for some internal projects. The framework is lightweight, well-structured, and provides a broad sprinkling of functionality via its libraries. I was happy for a chance to use it to build a site from the ground-up, and eager to see just how quick and painless it would prove to be.

Quick and Painless

The results were good. The portfolio came together in a couple of evenings -- just a few hours altogether, including an admin section for adding, editing, and ordering the various pieces.

I started coding the blog on the flight back from An Event Apart Boston, and was 90% finished when we touched down on the runway. Once back in the office, I wrapped up the comments functionality.

Along the way, we made several significant changes to the (X)HTML/CSS structure of the site, moving it from a fixed design (1024x768) to a fluid-width design that shrinks nicely to 800x600 screen resolutions. CodeIgniter's clean view/controller abstraction facilitated those changes perfectly.

Some Helpful Modifications

It's worth mentioning a few extensions we created that made the job even easier. We coded extensions to:

  1. Automatically call the set_fields() validation function when set_rules() is used, to reduce code and increase automation
  2. Preload the validation object with field values from any given object - specifically to preload forms with fields from a database select
  3. Prep validated POST arrays for database entry by comparing array keys to database table fields
  4. Include active-record functionality into the base Model class

We're happy to provide mentioned extensions if anyone's interested... just ask us for them using the contact form or by leaving us a comment.


Read This Next