Skip to content
World Wide Web Server edited this page Jul 4, 2012 · 18 revisions

[b]A Code Generator for CodeIgniter Forms[/b]

[b]The problem[/b]

Building validated forms in Code Igniter using the form_validation library takes too long. To build a form with the form validator and form libraries you need to enter the same value in multiple places; 3 times in the view, the label, the fields error message, and the field itself, again in the controller, once more in the model, and finally you need to setup the database schema to accept these values. This is repetitive and dull.

[b]The solution[/b]

Build a little application to automate the large majority of this process. You enter the field names, types, labels and validation rules and it generates all the code for a working validated form.

[b]Considerations[/b]

Forms tend to have some bespoke element (AJAX, sessions, custom callbacks etc). Often libraries and scripts tend to try and do the whole process and thus force you into a mold. FormIgniter should simply write 4 files; the MVC and the db schema and then get out of the way.

[b]Where can I find this?[/b]

A live application is at [url]http://formigniter.org/formigniter[/url]

Further explanation and code (coming soon) can be found at [url]http://formigniter.org[/url].

CodeIgniter Forum post: [url]http://codeigniter.com/forums/viewthread/111570/[/url]

Clone this wiki locally