PHP XML Form Builder

Whilst at Web on High I created an XML form builder to allow very quick creation of forms. The new framework will feature a brand new, much more feature complete XML form builder as well as an array form builder and a MySQL builder, the MySQL builder will include a full interface.

I’m creating the XML form builder first because I will use that to create the MySQL builder, the goal is to make creating forms incredibly simple, below is an example of the minimum code required to create a form with full validation, error highlighting and support for any form element, I’ve included the phpDoc comment from the constructor.

At the moment the builder only handles the text and textarea input, I’ll be adding support for the rest over the coming weeks.


/**
* Constructor
*
* Set up form properties
*
* @param string $xml XML file that contains form structure
* @param string $controller Controller for form
* @param string $action Action for form
* @param string $params Additional $_POST params
* @param boolean $post Submitted using $_POST
* @param boolean $multipart Multi-part form
*/
$formBuilder = new lib_form_builder_xml('test', 'formbuilder', 'addform');
$formBuilder->build_form();
return $formBuilder->get_html();