Rapid form bulding in PHP - Fork of pfbc/pfbc
The PFBC (PHP Form Builder Class) project is developed with the following goals in mind...
- Promote rapid development of forms through an object-oriented PHP structure.
- Eliminate the grunt/repetitive work of writing the html and validation when building forms.
- Reduce human error by using a consistent/tested utility.
This project was first release to the open source community on April, 24 2009 at PHPClass.org. It was moved to its current location at Google's Project Hosting service on November 16, 2009. Since the initial release, the project has gone through over 20 version releases and is still under active development.
The most significant enhancement in version 3.x is the integration with Bootstrap - a front-end framework from Twitter. Bootstrap incorporates responsive CSS, which means your forms not only look and behave great in the latest desktop browser, but in tablet and smartphone browsers as well.
PHP 5 >= 5.3
Before writing any code, you'll first need to download the latest version of PFBC and upload the PFBC directory within the document root of your web server. The other files/directories outside of the PFBC folder that are included in the download are provided only for instruction and can be omitted from your production environment.
The links provided below are meant to demonstrate the key features included in the project. Currently, these links are using the pfbc3.0-php5 release, please see the examples included with the project for PHP 5.3 namespaced examples.
<?php use PFBC\Form; use PFBC\Element\Texbox; use PFBC\Element\Select; use PFBC\Element\Button; session_start(); $form = new Form("GettingStarted"); $form->setDefaultUrlsJs( array( $form->getResourcesPath() . '/bootstrap/js/bootstrap.min.js', $form->getResourcesPath() . '/jquery/js/jquery.min.js' ) ); $form->setDefaultUrlsCss( array( $form->getResourcesPath() . '/bootstrap/ccs/bootstrap.min.css', $form->getResourcesPath() . '/bootstrap/css/bootstrap-responsive.min.css' ) ); $form->addElement(new Textbox("My Textbox:", "MyTextbox")); $form->addElement(new Select("My Select:", "MySelect", array( "Option #1", "Option #2", "Option #3" ))); $form->addElement(new Button); $form->render(); ?>