Part of the EllisLab Network
   
1 of 5
1
FormIgniter.org launched - Easy form generator - source code now available
Posted: 13 April 2009 05:18 PM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  66
Joined  08-11-2008

Here is something I put together over the Easter weekend.

The problem

Building validated forms in Code Igniter takes too long because names and values need to be entered multiple times. 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.

The Solution

Build a little application to automate the large majority of this process.

Considerations

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.

Where can I find this?

The live application is at http://formigniter.org/app

Further explanation and source code can be found at http://formigniter.org.

Closing Words

Let me know what you think, and any bugs you may find. I don’t intend to add much to it (simplicity is key), but will be tweaking the interface over the next couple of weeks to make it a little slicker.

Thanks,

 Signature 

FormIgniter - Easy form generator for the CodeIgniter framework
Too many tabs - My weblog about web app development, startups, productivity and life design
Barometer - The easiest way to add a stylish feedback form to your website.
My Github code - Sage Pay, Autoresponder, EPDQ libraries
Follow me on Twitter

Profile
 
 
Posted: 14 April 2009 11:35 AM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  17
Joined  01-08-2009

Wow.  That’s pretty cool.

Another shortcut you may want to put in there, though, is a text field for custom function validation.

Profile
 
 
Posted: 14 April 2009 05:30 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Rank
Total Posts:  56
Joined  09-12-2008

Amazing, thanks for sharing that.

Making forms and validating them with CI is easy, this just takes easy to a next level!

 Signature 

Personal Site | Twitter

Profile
 
 
Posted: 14 April 2009 06:25 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
RankRank
Total Posts:  200
Joined  07-31-2008

And people wonder why CodeIgniter is the best f***ing PHP framework out there. Bugs or no bugs, good job dude.

 Signature 

Spam Helper | Html Helper | GPoll Library | IMAP Library

Profile
 
 
Posted: 14 April 2009 06:29 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
RankRank
Total Posts:  200
Joined  07-31-2008

I just tried it out. WTF…lol. This is insane! I’m sure the more we play with we’ll find some flaws here and there, but this functionality is unparalleled. Hats off. Now I have to go off and find something better to contribute!  cool smirk

 Signature 

Spam Helper | Html Helper | GPoll Library | IMAP Library

Profile
 
 
Posted: 16 April 2009 10:11 AM   [ Ignore ]   [ # 5 ]  
Grad Student
Avatar
Rank
Total Posts:  66
Joined  08-11-2008

Hey guys, thanks for the encouraging feedback. It is really great to hear that you like FormIgniter.

bafadam - 14 April 2009 03:35 PM

Wow.  That’s pretty cool.

Another shortcut you may want to put in there, though, is a text field for custom function validation.

I presume you mean Callbacks http://codeigniter.com/user_guide/libraries/form_validation.html#callbacks which is a possibility. I wanted to keep the user interface as clean and uncluttered as possible. FormIgniter is intended to satisfy basic form validation requirements and then get out the way. My thinking was that custom callbacks need to be coded separately and so they could be added to the code FormIgniter generates. Interested to hear what others think about this though…

One thing that I would love to get some feedback on is whether the form_name Javascript autocomplete is useful. I find that it is for things like First Name where it would produce first_name, but it becomes less useful when your labels get longer. I think I will add a tickbox at the top to turn this feature ON or OFF.

Please let me know if you spot any bugs, or problems.

Thanks a lot everyone.

 Signature 

FormIgniter - Easy form generator for the CodeIgniter framework
Too many tabs - My weblog about web app development, startups, productivity and life design
Barometer - The easiest way to add a stylish feedback form to your website.
My Github code - Sage Pay, Autoresponder, EPDQ libraries
Follow me on Twitter

Profile
 
 
Posted: 17 April 2009 09:05 AM   [ Ignore ]   [ # 6 ]  
Summer Student
Avatar
Total Posts:  24
Joined  06-26-2008

OMG! You Rule!!

This is a massive time saver! You are a god send! This is a brilliant ‘app’ had a play and this looks great, keep up the good work dude!!!

We Salute you!

Profile
 
 
Posted: 13 May 2009 01:00 PM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  187
Joined  01-29-2008

the site seems to be down

downer

doodle

 Signature 

Shameless example of self promotion

Profile
 
 
Posted: 13 May 2009 01:11 PM   [ Ignore ]   [ # 8 ]  
Grad Student
Avatar
Rank
Total Posts:  66
Joined  08-11-2008
got 2 doodle - 13 May 2009 05:00 PM

the site seems to be down

downer

doodle

Just been playing around with Apache Bechmark. Looks like I pushed my 256MB slice a little too hard.

Everything is back online now.

 Signature 

FormIgniter - Easy form generator for the CodeIgniter framework
Too many tabs - My weblog about web app development, startups, productivity and life design
Barometer - The easiest way to add a stylish feedback form to your website.
My Github code - Sage Pay, Autoresponder, EPDQ libraries
Follow me on Twitter

Profile
 
 
Posted: 13 May 2009 01:24 PM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  187
Joined  01-29-2008

Slick!

Aren’t servers fun!!

doodle

 Signature 

Shameless example of self promotion

Profile
 
 
Posted: 13 May 2009 03:08 PM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  549
Joined  07-28-2008

Very cool. From here on out, it’s all about configuration!!!

For instance, I like to set my rules in 1 giant array, rather then seperate set rules function. This could be handled by a simple checkbox.

$rules = array(array('name' => 'field_name',
                     
'label'=> 'Field Name',
                     
'rules' => 'trim|callback__frank'),
         array(
'name' => 'field_name2',
                     
'label'=> 'Field Name 2',
                     
'rules' => 'trim|callback__frank2'),
               
             ); 

One additional item that I noticed is that one of the rules can be auto set, as well as the part in the view.

When creating the field you have the option for max length. The rules for the field should automatically set max_length[10] and on the view, the maxlength of the attribute ie <input type=“text” maxlength=“10”>

Very cool start to something here though!!! smile I guess from the configuration point, it’s really just about building it to be completely custom to how the user outputs code. If I could specify how it builds the output in the view, controller, model etc that is even sicker!!

 Signature 

~ 4 All the Right Reasons ~

Profile
 
 
   
1 of 5
1