There is no license information available for the latest version (dev-master) of this package.

A PHP library for creating and processing HTML forms

dev-master 2017-03-27 11:14 UTC


Yet another PHP library for creating and processing HTML forms (WIP).

How it's different?

  • It is intended for quick, configuration driven creation of contact forms that are sent by email. It is not intended for creating editing forms for database records.

  • Forms can either be defined by YAML configuration files (or by associative PHP arrays or any other format that can be turned into a PHP array) or programmatically using a fluent interface.

  • Forms are rendered either in a customizable generic way or by replacing the form elements in an HTML template containing the whole form.

  • Forms are processed using FormProcessors. Currently there is only a FormProcessor that sends the form by email using SwiftMailer but you can easily add your own form processor.

  • Form elements are created using DOM and are returned as DOM objects. This way, Formlib does not depend on a particular templating system but it is possible to alter the form and its elements after creation by manipulation the DOM, e.g. by adding and altering attributes.



Formlib is registered on packagist.org so it can be installed using composer:

require: "wa72/formlib": "dev-master"


See the "examples" directory.