| Resume | Public Directory | Copy/Paste

July 2011


CodeIgniter &PHP22 Jul 2011 08:36 am

There is an awesome (imo) PHP class that is helpful in auto-generating forms with client side (jquery) and server side (php) validation. My words cannot do it justice, so an excerpt from the the author, Stefan Gabos:

Zebra_Form is a PHP class that simplifies the process of creating and validating HTML forms. Its object-oriented structure promotes rapid HTML forms development and encourages developers to write clean and easily maintainable code. It frees the developers from the repetitive task of writing the code for validating forms by offering powerful built-in client-side and server-side validation.

I was using Zebra_Form a lot recently, actually, you can see my bug fix accredits and comments under the pseudo-name ‘Jack Ryan’ (I had have a Tom Clancy fascination…). Even more recently, I’ve been hooked on phonics with CodeIgniter (and sometimes have an affair with Bonfire).

If you look at the built in form validation in CodeIgniter 2.0, it is actually well put together. Unfortunately, it does not offer anything near the capabilities of Zebra_Form, which out of the box, is far more aesthetically pleasing. What I’m going to share is how I incorporated Zebra_Form in CodeIgniter while best preserving the MVC framework. Let’s get started. (more…)

CodeIgniter &PHP21 Jul 2011 10:24 pm

- Added author note:
This assumes the latest version of CodeIgniter (2.0.2) but I assume this will work on any CI 2.x with CSRF. All the code edits are in the XAJAX to make it more compatible with CodeIgniter, so the only things to keep in mind for CodeIgniter is the following:
- what is the name of my ci_csrf_token
- how do i generate my csrf hash
- how do i get an instance of CI
If you can answer that for your version of CodeIgniter, you should be ok. (more…)