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)0263MITPHP

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 2w 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

30

—

LowBetter than 61% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

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

2626d 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

[toplan/laravel-sms

A mobile phone number validation solution based on laravel

83580.2k2](/packages/toplan-laravel-sms)[hyperf/validation

hyperf validation

122.2M213](/packages/hyperf-validation)[udokmeci/yii2-phone-validator

Modern Yii2 Phone validator wrapper on top of PhoneNumberUtil library also used by Android devices

36227.5k1](/packages/udokmeci-yii2-phone-validator)[snowcap/vat-validation

EU VAT number validation

10112.3k](/packages/snowcap-vat-validation)

PHPackages © 2026

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