wa72/formlib

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 2020-04-28 13:38 UTC

This package is auto-updated.

Last update: 2024-11-29 00:05:09 UTC


README

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.

Dependencies

Installation

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

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

Usage

See the "examples" directory.