version 1.0

weather 28 Aug, 2008

Sorry there is no weather information available at this time.

contact us

Interested in working with us? We would love to hear from you.

what is a glossopteris?

Well simply put it is an ancient plant! Find out more.

about this site

This site is based on the CodeIgniter framework, coded with an iMac, hosted at Dreamhost and is best viewed in Firefox. To find out more about the site please click here.

codeIgniter Apple iMac Get Firefox!

journal

Real world apps with CodeIgniter: part II

In part I of this series we talked about the logistics management tool that Glossopteris developed for a US political candidate, using CodeIgniter (CI). Part II will focus on a campaign fundraising tool that was also developed with CI.

The initial brief was a simple web form that was to aid fundraisers in logging calls while active fundraising primarily for a call day that was to kick off the funding drive for the candidate. As the system required a solid security system and heavy validation CI was again the best choice. In fact here at Glossopteris we rarely do anything without CI anymore, the bank of code we have now makes doing vanilla php apps a little painful.

Before we even went live the clients came back asking for more features, taking what was a simple web form to a fully functioning fundraising tool with deep integration with Salesforce, credit card processing and reporting tools.

As we progressed integrating the application it became apparent that a slight modifcation to the CI core was going to make life a little easier. The following change to the Validation library allowed us to greatly extend the validation by allowing a central location for a number of custom validation callbacks.

 

 /* 
 if ( ! method_exists($this->CI, $rule)) { continue; }     
 $result = $this->CI->$rule($_POST[$field], $param); 
 */
if (method_exists($this->CI, $rule))
 { $result = $this->CI->$rule($_POST[$field], $param, $field); }
 else if (function_exists($rule))
 { $result = $rule($_POST[$field], $param, $field); }
 else
 { continue; }

 

This change, in addition to be able to centralise the validation callbacks, also allowed for some manipulation on the data prior to its respective CRUD action. This was a huge benefit it being able to do things such as obfuscating credit card numbers and adding in relevant event codes outside of the users control.

On a side note this technique also allows for inline file uploading, which is very useful as when all you need to do to enact the code is define the callback in the rules of the table relationships library. Building forms got fun again.....

So this application that was rolled out in the space of about a week and half became the primary tool for a team of campaign fundraisers that logged about 4500 calls in the first day alone. We experienced some issues on that first day with browser inconsistencies that did not mesh well with the CI user authentication and some duplicate records but on the main the whole thing performed admirably.

Some further additions to the application have been installing transactions with the Salesforce API which is a task in itself. Sadly Salesforce does not have a huge deal documentation for the PHP version of its API code so some it was guess work, but we got there eventually.

So once again we here have gotten through another major project with CI and really we cannot see ever starting anything large with out again.

Filed under Code Igniter | Posted by jamesnicol