EllisLab text mark
Advanced Search
1 of 4
1
   
FormIgniter.org launched - Easy form generator - source code now available
Posted: 13 April 2009 06:18 PM   [ Ignore ]
Avatar
Joined: 2008-08-11
56 posts

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

 
Posted: 14 April 2009 12:35 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2009-01-08
12 posts

Wow.  That’s pretty cool.

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

 
Posted: 14 April 2009 06:30 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2008-09-12
49 posts

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

 
Posted: 14 April 2009 07:25 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2008-07-31
194 posts

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

 
Posted: 14 April 2009 07:29 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Joined: 2008-07-31
194 posts

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

 
Posted: 16 April 2009 11:11 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2008-08-11
56 posts

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

bafadam - 14 April 2009 04: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://ellislab.com/codeigniter/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

 
Posted: 17 April 2009 10:05 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2008-06-26
22 posts

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!

 
Posted: 13 May 2009 02:00 PM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2008-01-29
181 posts

the site seems to be down

downer

doodle

 Signature 

Shameless example of self promotion

 
Posted: 13 May 2009 02:11 PM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2008-08-11
56 posts
got 2 doodle - 13 May 2009 06: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

 
Posted: 13 May 2009 02:24 PM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2008-01-29
181 posts

Slick!

Aren’t servers fun!!

doodle

 Signature 

Shameless example of self promotion

 
Posted: 13 May 2009 04:08 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2008-07-28
511 posts

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 ~

 
Posted: 13 May 2009 06:20 PM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2008-08-11
56 posts

drewbee, thanks for the insightful feedback. I really like the maxlength feature. As you say it is something thats suits FormIgniter. You enter the data quickly once and it reproduces it in numerous places; removing the repition is what it is all about. I will add this in when I get a moment, aswell as auto setting the ‘DB field Length/Values’ in the database Schema smile

drewbee - 13 May 2009 08:08 PM

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!!

Again the arrays format is interesting, and feeds into a larger question about what FormIgniter is for. When I use FormIgniter myself, I take its output (or sometimes just a section of it) as my base from which I can then add the more bespoke features (AJAX, custom callbacks, session data, autoresponders etc).

FormIgniter saves me time, and means I don’t have to do the boring drudge work. My idea was that 60-70% of building a validated form using CodeIgniters mechanisms is repition. If a code generator can do this for me then great!

However adding endless configuration options perhaps enters a situation of diminishing returns. As it is the interface is clean and IMO pretty easy to use. Perhaps it would be easy to complicate something that ultimate was designed for a simple task.

I intend to tidy the codebase up (horribly messy at the moment) and upload the source code. It would then be easy to customise the output to your way of working.

Thanks again for taking the time to post your thoughts.

 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

 
Posted: 17 September 2009 05:57 PM   [ Ignore ]   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2008-08-11
56 posts

Source code finally available at http://formigniter.org/source_code

 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

 
Posted: 17 September 2009 07:02 PM   [ Ignore ]   [ # 13 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-11
2985 posts

This should have a “more” button next to validation which could slide down an input box to write any validation rule in. Or it could use some reflection to get a list of all supported validation methods available (along the lines of get_class_methods.

It’s a very snazzy little app though, good job! grin

 Signature 

————————
Blog | Twitter | GitHub | BitBucket
————————-
PyroCMS - open source modular CMS built with CodeIgniter
PancakeApp - Simple, hosted invoicing/w project management

 
Posted: 18 September 2009 01:50 AM   [ Ignore ]   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2009-09-14
16 posts

I can’t download….it

please…any another link…to get the source


thank’s

M4d3

 Signature 

Gaya Fusion - Ceramic & Design

 
Posted: 18 September 2009 07:01 AM   [ Ignore ]   [ # 15 ]   [ Rating: 0 ]
Avatar
Joined: 2008-08-11
56 posts

Now corrected smile

 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

 
1 of 4
1