PHPackages                             modus/forms - 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. modus/forms

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

modus/forms
===========

A form validation library for Modus Framework.

2.1(7y ago)0186MITPHP

Since Sep 13Pushed 7y agoCompare

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

READMEChangelogDependencies (2)Versions (4)Used By (0)

Forms
=====

[](#forms)

Forms is a dead simple library for validating incoming data, whether that data be from the $\_POST superglobal or from the CLI, or from any other source.

Setup
-----

[](#setup)

In order to use Forms, you need to extend the `FormsBase` class, and implement two values: `$fields` and `configureValidations()`.

The `$fields` property contains an array of fields you'll be passing into the form, for the purposes of separating the valid content from content you don't care about. It should be an array of valid strings:

```
$fields = [
  'username',
  'password',
  'password_verify',
];
```

Once you have defined the `$fields` property, you can build your validations in the `configureValidations()` method.

```
protected function configureValidations()
{
  $filter = $this->filter;
  $filter->addSoftRule('username', $filter::IS, 'alnum');
  $filter->addSoftRule('username', $filter::IS_NOT, 'blank');
  $filter->addSoftRule('password', $filter::IS_NOT, 'blank');
  $filter->addSoftRule('password_verify', $filter::IS, 'equalToField', 'password');
}
```

Using Forms
-----------

[](#using-forms)

Once you have completed basic setup, now you're ready to use Forms.

To populate the form, call the `populateData` method with an array of data to be populated and filtered.

To filter the data, call `validate()`.

The `getError`, `hasErrors` and `getErrors` functions all provide access to various errors, if `validate()` should return false. You can use `isValid()` to determine if there are errors to be retrieved.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity65

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

Total

3

Last Release

2580d ago

Major Versions

1.0 → 2.02017-08-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8217163?v=4)[Savage](/maintainers/sarahsavage)[@sarahsavage](https://github.com/sarahsavage)

---

Top Contributors

[![brandonsavage](https://avatars.githubusercontent.com/u/197889?v=4)](https://github.com/brandonsavage "brandonsavage (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/modus-forms/health.svg)

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

###  Alternatives

[marcosh/php-validation-dsl

A DSL for validating data in a functional fashion

483.9k](/packages/marcosh-php-validation-dsl)

PHPackages © 2026

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