Designing for CodeIgniter
Published by Justin
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:
- Dynamic portfolio pieces, with the top-most piece published automatically to the home page
- Static (X)HTML for the about and contact pages
- A contact form
- 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:
- Automatically call the set_fields() validation function when set_rules() is used, to reduce code and increase automation
- Preload the validation object with field values from any given object - specifically to preload forms with fields from a database select
- Prep validated POST arrays for database entry by comparing array keys to database table fields
- 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.

Thanks for talking about this. I have been a web designer for a few years for my company but we are now wanting to turn to a CMS. I have narrowed it down to Drupal and Code Igniter just like you. I've found myself very confused as to how to customize Drupal to what we need so I'm extremely intrigued about a custom approach from Code Igniter. I would love any other insight you guys have on CI. Thanks again.
Just came across your site while scanning cssmania. Your site came out perfectly. I'm excited to hear you're using Code Igniter as I've been using it for the last several sites I've made. I'd love to see the extensions you created. I've been meaning to redo my own site on the framework, but have been afraid of losing my pagerank etc... (all asp so it has yucky urls etc).
Thanks! Again the site looks superb.
Joseph: I'll put those extensions together, upload them, and comment the URL.
Jonathan: Drupal has an enormous set of features, a large and active community, and a robust (though procedural, and definitely not MVC) underlying development framework. CI provides clean and flexible structure for quickly building applications... but it doesn't offer the kind of plug-and-play functionality you would get from a CMS. Our experience is that long-term costs are almost always higher when building an application rather than using one that is already out there... that said, it all depends on the sort of things you are trying to accomplish.
I'd be happy to discuss further if you are interested... just shoot me an email via our contact form.
Before mentioned extensions are available at: ci_classes.zip
Great to hear you guys are CodeIgniter enthusiast. When we work on any kind of bespoke backend systems we either use CI or Symfony.. both are great inventions, help save your time and money. Drupal indeed is kind of "monster".. a way too big thing to use it for small or even medium websites. Good luck with all your endeavours and thank you for extensions!
[...] at the bottom of the posts, two of the links I had never seen before: Aten Design Group discusses redesigning their website with CodeIgniter and a Zend Podcast with a CodeIgniter Overview (actually, I believe I have seen the latter but [...]
Justin,
Good write up.
I myself am either considering either using a CMS (Joomla) or a PHP framwork.
Two questions would provide extra information: a) How long was your flight?
b) You said: "Our experience is that long-term costs are almost always higher when building an application rather than using one that is already out there… that said, it all depends on the sort of things you are trying to accomplish." Did you already know that it would cost more before starting this project with CI?
cheers.
I would like to know how you can easily get static pages in CI without using a controller. I have a site with many static pages with some dynamic feature in the sidebar of each of these pages. What would you suggest I can do to achieve this like your about and contact pages.
I will be very grateful for your help.
Hi, I'm new to CodeIgniter and would very much like to get a hand on your extensions.
:P
Thanks, Yannick
I know I'm way late to the party, but I'd also love to have a look at the classes you've created, and it appears the link you posted above no longer works. :(
I would be interested in seeing the extensions you mentioned above... sounds very helpful.
Hi,
CI is a really great, lightweight framework.
Faster than symfony and easier to use than Cake.
great post.
How long was that flight?
Hi.. I'm newbie and building my apps. Would like to get your extensions. Thanks for sharing your work..