Fork me on GitHub

Nibble Development

Nibble Development

PHP classes and libraries for developers

PHP libraries and classes

Nibble development currently supports a number of PHP libraries.  Whether or not they are actively developed or stable and not developed is outlined in the description of each library below.  Please feel free to browse the libraries and use the code as you will.  All code is downloadable as a Git repository from GitHub along with the correct Open Source licence.

Nibble Forms 2 (check it out)

Nibble Forms 2 is a fast and easy to use PHP form class written in PHP 5.3 for generating and validating HTML forms.  It is re-design of the original PHP form class “Nibble Forms”.  After much time spent tweaking Nibble Forms, it was evident that there were a number of flaws with the code that needed to be addressed.  This led to the creation of Nibble Forms 2 because the changes were not possible in the original code whilst still keeping forms written for the original code working.  Some of the improved features of Nibble Forms 2 are outlined below:

  • Requires less PHP code to be written for each form
  • PHP namespaces and autoloader cleans up the code base and allows each field to be easily overwritten, extended and not loaded unless needed.
  • Accepts any number of attributes for each form field in an array
  • Arguments are passed as an array so the order of arguments for each field type does not have to be remembered
  • Form fields can be rendered individually with a simple render call, HTML for the requested field is then returned.  This allows for far more control of the HTML around a rendered form
  • Forms can be submitted as POST or GET

Nibble Framework (check it out)

The Nibble Framework is a simple PHP plugin based framework that uses a drag and drop admin system to activate  and deactivate plugins.  The system was initially developed as a final year computer science project at Loughborough university and then continued to evolve.  Plugins are uploaded into the “bites” directory and then can be instantly dragged into the active column to start using them.  Plugins can have dependencies on other plugins and can also come with scripts, css and images that will be installed into the web root on activation.  Out of the box there is some useful functionality in the form of two plugins:

  • A user system that allows admin to create and manage users, user groups and manage permissions of each user group.  Permissions are based on public actions in other plugins controllers, each action can be individually denied or allowed for each user group
  • A bloging system and comments for the blog allow the admin to create blog posts, edit and delete them and moderate comments.  The blog has a full editor with a live preview including image management

Nibble Forms (check it out)

Nibble Forms is a simple PHP form class that allows developers to quickly create HTML forms with a small amount of PHP code.  Each type form field has its own built in validation, most of which is modifiable including:

  • if the field is required
  • valid answers lengths
  • valid selections from choice fields
  • pattern matching using preg_match for submitted answers

Once a form has been made using the simple PHP notation, it can be rendered with one line.  Nibble forms will then render the form in a list or a table depending on the argument for the layout passed on instantiation.  As well as rendering with one line, Nibble Forms can also validate post data with one PHP call to is valid which will then render errors with the form next time it is displayed to the user.

Other features of Nibble Forms include:

  • Multiple error messaging styles including flash messaging
  • Custom HTML around fields
  • CRSF protection as standard
  • HTML 5 form fields
  • The ability to handle multiple forms on one page

Nibble Flash Messaging (check it out)

Nibble flash messaging is a PHP class that allows messages to be created that are then displayed to the user using a JQuery script by Tim Benniks and a little extra JQuery added by us. Nibble flash messaging is a very simple and easy to use class, there are 2 types of messages, regular messages which are displayed on the same page they are created, or flash messages which are displayed on the next page load. The flash messages are useful for sites such as blogs where, for example, the “create post” PHP script adds a new post to the database and then redirects to a new page. Using the flash message, the create post script can add a message that will be displayed on the page that the user is redirected to. Nibble Forms and the Nibble Framework make use of this PHP class.

Luke Rotherfield

Freelance PHP Developer
is a PHP developer dedicated to writing the most awesome liraries for his fellow devs :) enjoy

Latest posts by Luke Rotherfield (see all)

Leave a Comment