PHPackages                             seanmorris/form - 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. seanmorris/form

ActiveLibrary

seanmorris/form
===============

Simple, Object oriented forms for PHP.

1.0.4(4y ago)23.2kApache-2.0PHP

Since Feb 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/seanmorris/form)[ Packagist](https://packagist.org/packages/seanmorris/form)[ RSS](/packages/seanmorris-form/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (9)Used By (0)

SeanMorris\\Form
================

[](#seanmorrisform)

Rapid, themable forms for PHP.
------------------------------

[](#rapid-themable-forms-for-php)

[![Build Status](https://camo.githubusercontent.com/07e1b656e877327b66a7714f1ed297d863fe41915774efdc117122bcc5d296a9/68747470733a2f2f7472617669732d63692e6f72672f7365616e6d6f727269732f666f726d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/seanmorris/form) [![Latest Stable Version](https://camo.githubusercontent.com/7deccab8dc20fb8f40c0c6f67f220ab950abc224e9444c5cdecd59beca2bd529/68747470733a2f2f706f7365722e707567782e6f72672f7365616e6d6f727269732f666f726d2f762f737461626c65)](https://packagist.org/packages/seanmorris/form) [![Total Downloads](https://camo.githubusercontent.com/c088b8b10b1ae3b5d452cf2ec92b8f17ecc15a777066545aa808ea9334ec5f44/68747470733a2f2f706f7365722e707567782e6f72672f7365616e6d6f727269732f666f726d2f646f776e6c6f616473)](https://packagist.org/packages/seanmorris/form) [![Latest Unstable Version](https://camo.githubusercontent.com/2740ce6ad66025110e1e26cb45528257b3b6d6ac152f4c56419da35d9640033f/68747470733a2f2f706f7365722e707567782e6f72672f7365616e6d6f727269732f666f726d2f762f756e737461626c65)](https://packagist.org/packages/seanmorris/form) [![License](https://camo.githubusercontent.com/b65a1d775de65d7c7c91d979b63c8d86c8b7587f379622c1c116c797fe0ed18d/68747470733a2f2f706f7365722e707567782e6f72672f7365616e6d6f727269732f666f726d2f6c6963656e7365)](https://packagist.org/packages/seanmorris/form)

The Form library allows you to rapidly develop, theme, and validate forms, so you can get back to programming.

Creating a Form
===============

[](#creating-a-form)

Creating a form is simple. Elements starting with a letter or number are fields. Elements starting with underscores are special keys. For example `_method` allows you to set the choose a GET or POST request for your form.

Elements starting with a letter or number are rendered directly into the &lt;input&gt; or &lt;select&gt; tag. Elements beginning with an underscore are passed to logic but not rendered.

For example, the \_title attribute generates a &lt;label tag for the form field.

```
$skeleton['_method'] = 'POST';

$skeleton['testField'] = [
  'type' => 'text'
  , '_title' => 'Test Field'
];

$skeleton['submit'] = [
  '_title' => 'Submit'
  , 'type' => 'submit'
];

$form = new \SeanMorris\Form\Form($skeleton);

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

Validation
==========

[](#validation)

Validators are specified on the \_validators key. Its an array keyed by validator class. The values are arrays of arguments to pass to the constructor.

```
$skeleton['testField'] = [
  'type' => 'text'
  , '_title' => 'Test Field'
  , '_validators' => [
    'SeanMorris\Form\Validator\Regex' => [
      '/.{8,}/' => '%s must be at least 8 characters'
    ]
  ]
];
```

Filtering and validating submitted values is simple:

```
$form->setValues($_POST);

if($form->validate())
{
  // Values will only contain keys for each of the fields.
  $values = $form->getValues();
}
else
{
  $errors = $form->erorrs();
}
```

More...
-------

[](#more)

For the field type list, validator list, and usage guide read [DOCS](DOCS.md).

For the guide to extending the library to create new field types, read [EXTENDING](EXTENDING.md).

For legal information, check [LICENSE](LICENSE) and [NOTICE](NOTICE).

[README](README.md)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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 ~307 days

Recently: every ~537 days

Total

8

Last Release

1578d ago

Major Versions

0.0.9 → 1.0.02016-02-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/df0c384d917994b35efdf4aa78d3f1e06737d314bd9815c1321ed45ba73cbc50?d=identicon)[seanmorris](/maintainers/seanmorris)

---

Top Contributors

[![seanmorris](https://avatars.githubusercontent.com/u/640101?v=4)](https://github.com/seanmorris "seanmorris (75 commits)")

### Embed Badge

![Health badge](/badges/seanmorris-form/health.svg)

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

PHPackages © 2026

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