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

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

eredi93/forms
=============

Form generation and validation

0.3.0(9y ago)143MITPHPPHP &gt;=5.5

Since Mar 21Pushed 9y agoCompare

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

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Forms
=====

[](#forms)

Easy to use &amp; highly customisable PHP package for Form generation and data validation. Supports [PSR-7 HTTP-Message](http://www.php-fig.org/psr/psr-7/).

- Generate HTML forms
- Validate data
- PSR-7 HTTP-Message

**Note: This package has been developed under Slim3 and is the only Framework supported at the moment.**

Installing
----------

[](#installing)

Install using Composer.

```
{
    "require": {
        "eredi93/forms": "0.2.*"
    }
}
```

Basic usage (Slim 3)
--------------------

[](#basic-usage-slim-3)

Extend basic Form and within the setUp method set the form fields

```
use Forms\From;
use Forms\Validators\Required;

class LoginForm extends Form
{
    protected function setUp()
    {
        $this->fields = [
            (new TagOpen(['class' => "wrapper"])),
            (new TextInput("identifier"))
                ->setLabel("User / Email")
                ->setAutocomplete("off")
                ->setDecoratorClass("input-field col s12")
                ->setValidators([
                    new Required(),
                ]),
            (new PasswordInput("password"))
                ->setLabel("Password")
                ->setDecoratorClass("input-field col s12")
                ->setValidators([
                    new Required(),
                ]),
            (new SubmitButton())
                ->setDecoratorClass("input-field col s12")
                ->setClass("btn yellow right")
                ->setText("Login"),
            (new TagClose(),
        ];
    }
}
```

now that you have your form created instantiate it in the GET controller

```
public function login(Request $request, Response $response, $args)
{
    // Instantiate Form
    $form = new LoginForm();
    /**
     * You can pass to the form the method action and the CSRF name
     * by default the form uses
     * - $action=""
     * - $method="POST"
     * - $csrf=['csrf_name', 'csrf_value']
     */
    // Render Form
    echo $form->render($request);

    return $response;
}
```

to validate the form in POST controller call the validate method

```
public function loginPost(Request $request, Response $response, $args)
{
    // Instantiate Form
    $form = new LoginForm();

    // Check validation
    if ($form->validate($request)) {
        /*
        *   Form validation passed log in the user
        */
    }

    // Render Form with validation
    echo $form->render($request);

    return $response;
}
```

Contributing
------------

[](#contributing)

Please file issues under GitHub, or submit a pull request if you'd like to directly contribute.

Running tests
-------------

[](#running-tests)

Tests are run with phpunit. Run ./vendor/bin/phpunit to run tests.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

3629d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1167afe96e9cd4d7f3586b3ce20c80a0ede6042d029ac94ca3f93ec01ddf7971?d=identicon)[eredi93](/maintainers/eredi93)

---

Top Contributors

[![eredi93](https://avatars.githubusercontent.com/u/10990391?v=4)](https://github.com/eredi93 "eredi93 (11 commits)")

---

Tags

validationForms

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  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.

54013.2M450](/packages/nette-forms)[karser/karser-recaptcha3-bundle

Google ReCAPTCHA v3 for Symfony

1862.4M7](/packages/karser-karser-recaptcha3-bundle)[pear/html_quickform2

Provides methods to create, validate and render HTML forms in PHP.

24498.9k2](/packages/pear-html-quickform2)[sheadawson/silverstripe-zenvalidator

Faster, easier client and server-side form validation for SilverStripe

5778.4k2](/packages/sheadawson-silverstripe-zenvalidator)[hybridlogic/validation

A simple, extensible validation library for PHP with support for filtering and validating any input array along with generating client side validation code.

641.1k](/packages/hybridlogic-validation)

PHPackages © 2026

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