PHPackages                             glynnforrest/reform - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. glynnforrest/reform

AbandonedArchivedLibrary[Validation &amp; Sanitization](/categories/validation)

glynnforrest/reform
===================

Create forms that render and validate with ease.

0.4.0(11y ago)11.0k1MITPHPPHP &gt;=5.3.0

Since Apr 2Pushed 7y ago1 watchersCompare

[ Source](https://github.com/glynnforrest/reform)[ Packagist](https://packagist.org/packages/glynnforrest/reform)[ RSS](/packages/glynnforrest-reform/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (4)Versions (10)Used By (1)

Reform
======

[](#reform)

[![Build Status](https://camo.githubusercontent.com/890fe163e85c5e34ffcc7b6a8894afe4efdc08a4dbfc491bbb5998cef5f743e7/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f676c796e6e666f72726573742f7265666f726d2f6d61737465722e737667)](https://travis-ci.org/glynnforrest/reform)[![Packagist](https://camo.githubusercontent.com/02188f63d37db098ab5f0c2cbbc16d49af93759e7dcf238f53016dafd42c71a8/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676c796e6e666f72726573742f7265666f726d2e737667)](https://packagist.org/packages/glynnforrest/reform)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)

Reform makes it easy to create forms in PHP. Create a form, add rows and validation, then call `render()`. Everything else is done automatically - checking for submissions, validating data, setting values, creating labels and error messages, handling CSRF...

For greater control, the form can be rendered row-by-row, or even in individual pieces. You can use only a few features without the rest getting in the way.

Features
--------

[](#features)

- Many row types and validation rules. It is trivial to add custom types to match your requirements.
- Different renderers to apply styles to the form (e.g. Bootstrap). Changing the renderer can be done with a single line of code.
- Integration with [Symfony HttpFoundation](https://github.com/symfony/HttpFoundation)to automatically submit forms.
- Security measures like honeypot fields, timers, and CSRF protection. Add the [Blockade](https://github.com/glynnforrest/blockade) security library to have these exceptions handled automatically.
- Events to customize how forms behave.

Quickstart
----------

[](#quickstart)

A simple form with a username and password field.

```
$form = new Reform\Form\Form('/login');
$form->text('username');
$form->password('password');
$form->submit('login');

echo $form->render();
```

Now with some validation.

```
$form = new Reform\Form\Form('/login');
$form->text('username')
    ->addRule(new Rule\Required('Did you forget your name?'))
    ->addRule(new Rule\Regex('`[A-z.]+`'))
$form->password('password')
    ->addRule(new Rule\Required());
$form->submit('login');
```

Submit the form automatically by using a Symfony Request object. If the correct HTTP method was used and all fields have passed the required validation, the form is considered valid.

Valid or not, after a submission the fields are populated with the submitted data.

```
$request = Request::createFromGlobals();
$form->handle($request);

if ($form->isValid()) {
    //the form was submitted correctly - the correct http method was
    //used and all validation rules passed

    //perform the login and redirect
    login_user();
    redirect_to_home_page();
}
//the form was either not submitted or failed the validation. $form
//now has any submitted parameters bound to it, so all we need to do
//is render the form again. Any values and errors will be added
//automatically.

echo $form->render();
```

See `docs/` for further documentation.

Installation
------------

[](#installation)

Install using composer:

```
{
    "require": {
        "glynnforrest/reform": "0.4.*"
    }
}
```

Viewing the examples
--------------------

[](#viewing-the-examples)

```
composer install
cd examples/
bower install
php -S localhost:8000
```

Then visit `localhost:8000` in your web browser.

These instructions assume you have composer, bower and PHP 5.4 installed.

License
-------

[](#license)

MIT, see LICENSE for details.

Copyright 2014 Glynn Forrest

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~43 days

Recently: every ~62 days

Total

7

Last Release

4215d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/578458?v=4)[Glynn Forrest](/maintainers/glynnforrest)[@glynnforrest](https://github.com/glynnforrest)

---

Top Contributors

[![glynnforrest](https://avatars.githubusercontent.com/u/578458?v=4)](https://github.com/glynnforrest "glynnforrest (209 commits)")

---

Tags

validationformcsrfHoneypot

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/glynnforrest-reform/health.svg)

```
[![Health](https://phpackages.com/badges/glynnforrest-reform/health.svg)](https://phpackages.com/packages/glynnforrest-reform)
```

###  Alternatives

[nette/forms

📝 Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server &amp; client side validation and mature design.

53013.5M486](/packages/nette-forms)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M50](/packages/proengsoft-laravel-jsvalidation)[stefangabos/zebra_form

A jQuery augmented PHP library for creating and validating HTML forms

961.2k](/packages/stefangabos-zebra-form)[siriusphp/validation

Data validation library. Validate arrays, array objects, domain models etc using a simple API. Easily add your own validators on top of the already dozens built-in validation rules

159763.3k13](/packages/siriusphp-validation)[barbieswimcrew/zip-code-validator

Constraint class for international zipcode validation

772.4M](/packages/barbieswimcrew-zip-code-validator)[fp/jsformvalidator-bundle

Javascript validation for sf\[2|3|4\] forms.

127421.3k1](/packages/fp-jsformvalidator-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
