This project promotes rapid development of HTML forms through an object-oriented PHP framework.
Unlike the 2.x branch, version 3.x doesn't represent a complete rewrite from its previous version. In fact, most of the PHP code for creating and validating forms has remained unchanged in this new major version release. So, what's different?
The most significant enhancement 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. To see responsive CSS in action, resize your browser window and watch how the login form in the Getting Started section responds.
Another enhancement in version 3.x is the addition of 13 HTML5 elements, which you can check out in our HTML5 example. HTML5 form elements and attributes improve your form's usability - especially on tablets and smartphones where data is entered with virtual keyboards.
Here are a few more differences between PFBC 3.x and 2.x to be aware of if you're planning on upgrading.
Before writing any code, you'll first need to download the latest version of PFBC, extract the contents of the zip file, and upload the PFBC directory within the document root of your web server. The other files/directories outside of the PFBC folder (like this one) that are included in the download are provided only for instruction and can be omitted from your production environment.
Important This project maintains two separate code bases - one for PHP 5 and another for PHP 5 >= 5.3.0. The primary difference is the use of namespaces in PFBC 3.1 (PHP 5 >= 5.3.0). Namespaces weren't introduced in PHP until version 5.3.0, so if you're web server is running an older version of PHP 5, then you will need to use PFBC 3.1 (PHP 5).
Once the PFBC directory is up on your web server, you're ready to create your first form. Below you'll find a sample login form that we'll talk through in detail.
<?php session_start(); use PFBC\Form; use PFBC\Element; include("PFBC/Form.php"); $form = new Form("login"); $form->addElement(new Element\HTML('<legend>Login</legend>')); $form->addElement(new Element\Hidden("form", "login")); $form->addElement(new Element\Email("Email Address:", "Email", array(     "required" => 1 ))); $form->addElement(new Element\Password("Password:", "Password", array(     "required" => 1 ))); $form->addElement(new Element\Checkbox("", "Remember", array(     "1" => "Remember me" ))); $form->addElement(new Element\Button("Login")); $form->addElement(new Element\Button("Cancel", "button", array(     "onclick" => "history.go(-1);" ))); $form->render();
<?php session_start(); include("PFBC/Form.php"); $form = new Form("login"); $form->addElement(new Element_HTML('<legend>Login</legend>')); $form->addElement(new Element_Hidden("form", "login")); $form->addElement(new Element_Email("Email Address:", "Email", array(     "required" => 1 ))); $form->addElement(new Element_Password("Password:", "Password", array(     "required" => 1 ))); $form->addElement(new Element_Checkbox("", "Remember", array(     "1" => "Remember me" ))); $form->addElement(new Element_Button("Login")); $form->addElement(new Element_Button("Cancel", "button", array( "onclick" => "history.go(-1);" ))); $form->render();