Code Igniter programmer, and good friend, James Nicol has written up a wonderful summary of his experience using Code Igniter in a production environment that he's called "Real world apps with CodeIgniter: part 1". His company developed a scheduling and logisitics management application for one of the candidates for the next US federal election (he isn't saying whom yet). His solution included building in table relationships, dynamic PDF generation, AJAX and javascript effects and CI used in a real-world app.
For a project I'm currently working on, subscribed users get up to the minute most current information (as outlined by a date field in MySQL). Unsubscribed users get the information still, only it is a day behind.
Due to the way the information is going into the system, there could be multiple entries for one date, and then no entries for a few days, then new, etc. Basically, the information cannot be predicted by the application. Retrieving the most recent date is trivially easy with a MAX command, but there is no "almostMAX" command, so I found myself staring at the screen wondering what the most efficient way to approach this was. Here's my solution:
SELECT * FROM table GROUP BY dateIssued ORDER BY dateIssued DESC LIMIT 1,1
Fortunately for me, LIMIT accepts offsets, and I can specific to grab only the second entry. If you can think of a more elegant way to do this (or heck, if you just want to comment), please leave a note below.
One of the very nice things about CodeIgniter (and really all the PHP frameworks I've looked at) is the built in security tools. For example, CodeIgniter automatically cleans cookies, sessions, user input and URLs in addition to coming with a host of other built in tools to make your job in securing your application as easy as possible. But, like all good things, there is a trade off. In the case of security, the trade off is convenince. The more secure, the less convenient. Since security isn't really something we can compromise on, clever developers need to find alternate ways of implementing common things.
CodeIgniter for example limits the characters that one can use in a URL to letters, numbers, and "~, %, :, _ and -". A good collection sure, but what if you need to pass other characters, such as "(, ), =" or even spaces? Here's how I did it.
I've had a few requests asking how I built my RSS feed since I'm using a custom built Code Igniter blogging system. Actually, it was pretty straight forward, but I thought I'd take a few moments to outline step by step how I did it.
Hmm... lools like my love affair with SQL related posts continues.
MySQL has posted an excellent resource posted called Top 10 SQL Performance Tips. Although, it is kind of a misleading name, since its a wiki, and everybody is able to post. Currently it's up to 84 tips, most of which look really great. Here is a small sampling...
UGH! So apparently I need one of those Matrix-style brain implants to help me remember SQL.
I'm writing this down now as both a personal reminder... and maybe I'll save you from the same fate. When writing the archive for this blog, I wanted to create friendly URLs, so that /blog/archive would display all posts, /blog/archive/2006 would show all of the posts from 2006, and finally /blog/archive/2006/11 would show all of the posts from November of 2006. Simple enough right?
When I originally released BambooInvoice I learned a lot about trying to code for a site specific goal, and coding for a mass audience. I originally wrote these tips on the Code Igniter forums, but since I was recently asked for advice again, I thought I'd repost them here. The original thread is still active.
Since I released BambooInvoice I've received a number of interested emails from developers looking for tips on getting started building an application using code igniter that you intend to widely distribute. Here is a small collection of useful processes.
I don't like the way Firefox 2 handles closing tabs. Here's how I fixed my Firefox to get back to the behaviour I wanted.
There’s been some interest in the past for video tutorials that are a bit more advanced.
What I’ve done is created a 20 minute (yeah, I wish it was shorter too) video tutorial where I tried to use some advanced techniques. In it, I tried to hit on AJAX usage, the scriptaculous library for both visual effects and an autocompleting search form, models, and unobtrusive javascript techniques.
This is not a gentle introduction into Code Igniter. I spend hardly any time explaining how to set up controllers and views. The target audience is really people who have hacked around with CI a bit, and are wanting some insight into how somebody else does it. I don’t claim my techniques are perfect, but I’m betting that a little insight into someone else’s mind might be useful, and I think generally web devs could benefit from more CSS and unobtrusive javascript.
Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards.
I’ve written and posted a Microformats Helper on the Code Igniter wiki. This helper is meant to ease the creation of various well known microformats. Currently, the most popular hCard format is supported. Edit: license is also now supported.