| CodeIgniter 2 with CSRF and Zebra_Form |
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…)