Nibble Forms 2: PHP form generation class

Over on Nibble Development we just launched the eagerly awaited Nibble Forms 2  (our new and improved PHP form class) and a restyle for the site while we were at it.

The original Nibble Forms is a great class and was fun to write but it had some inherent flaws.  To fix the flaws would have rendered all forms already written using the old code broken.  For this reason we re-wrote the code adding in new features to make Nibble Forms 2 a far more flexible and easier to use PHP form class.

Some of the notable improvements include:

  • PHP namespaces for all classes including fields.  This means that extending or adding a field is even easier as you can just create a PHP file in the fields directory with the correct namespace and start using it without hacking apart the Nibble Forms core code
  • Single elements of a form field can be rendered on their own like the input or the label or the error messages.  This means custom HTML is far easier to write around form fields.  Whole rows can also be rendered with the renderRow() method
  • Forms are now named so data can be retrieved from $_POST and $_GET without getting other data not specifically from the form.  i.e form data is now in $_POST[‘form_name’] rather than just $_POST
  • More HTML5 validation and control over it.
  • More field types as standard

A quick example of a contact form with Nibble Forms 2:


The following two tabs change content below.
Is a Symfony2 PHP developer in Nottingham. Luke is a Symfony2 wizard and has written some sweet libraries of his own published on Luke loves Jesus, his gorgeous wife and his two beautiful daughters :)


Leave a Reply

%d bloggers like this: