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

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

mintyphp/forms
==============

v1.1.13(1mo ago)21231MITPHPPHP &gt;=7.4

Since May 16Pushed 1mo agoCompare

[ Source](https://github.com/mintyphp/forms)[ Packagist](https://packagist.org/packages/mintyphp/forms)[ RSS](/packages/mintyphp-forms/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (10)Dependencies (5)Versions (18)Used By (1)

MintyPHP Forms
==============

[](#mintyphp-forms)

MintyPHP Forms is a powerful PHP form builder that enables you to create and validate forms without having to write a lot of boilerplate code.

Features
--------

[](#features)

- Bulma renderer, easily creating good looking forms
- Validation rules, such as validating email, string length and numeric comparisons
- Support checkbox arrays and multi selects
- Best practices: follows best practices, well-tested, object oriented code
- Extensible: create support for your favorite framework or form rendering style

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

[](#installation)

Run the following command to install MintyPHP Forms with Composer.

```
composer require mintyphp/forms
```

The package has no dependencies on other packages.

Quick Start
-----------

[](#quick-start)

Add the following to alias the most used classes in your PHP file:

```
use MintyPHP\Form\Elements as E;
use MintyPHP\Form\Validator\Validators as V;
```

Now ensure all classes are (auto)loaded:

```
require_once 'vendor/autoload.php';
```

And create a simple login form using:

```
$form = E::form([
    E::field(E::text('username'),E::label('Username'),[V::required('Username is required')]),
    E::field(E::password('password'),E::label('Password')),
    E::field(E::submit('Login')),
]);
```

Now render the form using:

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

And the output is:

```

    Username

    Password

```

Easy as that.

Frontend frameworks
-------------------

[](#frontend-frameworks)

MintyPHP Forms has support for the Bulma framework right out of the box. Just tell MintyPHP Forms that you want to use Bulmas style forms using:

```
E::$style = 'bulma';
// create and render the login form
$form = E::form([
    E::field(E::text('username')->required(), E::label('Username')),
    E::field(E::password('password'), E::label('Password')),
    E::field(E::submit('Login')),
]);
$form->render();
```

And the output will be form in the familiar Bulma style:

```

    Username

    Password

```

In the future we will add support for other frameworks, such as bootstrap 5.

Backend frameworks
------------------

[](#backend-frameworks)

This package has been tested with the MintyPHP backend framework. It can also be used with other frameworks as this package has no dependencies at all.

Although we don't recommend you to use MintyPHP Forms without a backend (or frontend) framework, it is certainly possible, see the full example.

Full example
------------

[](#full-example)

The Form object has the following data methods:

- **fill**: Fill the form with an array of data (e.g. $\_POST)
- **validate**: Validate the form and add errors where needed
- **addErrors**: Add custom errors (after validation)
- **extract**: Extract the filled in form values
- **render**: Output the form with or without root element

These data methods are typically used on GET:

- GET:
    - fill (with default values or from database)
    - render
- POST:
    - fill (from POST data)
    - validate
        - on success: extract
        - on errors: render

You can see how these are used in the following full example:

[Full example - PHP code - Click here](example.php)

After filling in a password and clicking "Login" it renders as:

[![example.png](example.png)](example.png)

Interested? Read the rest of the [documentation](docs/overview.md).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance89

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

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

Recently: every ~96 days

Total

16

Last Release

57d ago

### Community

Maintainers

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

---

Top Contributors

[![mevdschee](https://avatars.githubusercontent.com/u/1288217?v=4)](https://github.com/mevdschee "mevdschee (127 commits)")

---

Tags

bulmaform-builderform-handlingform-validationforms-generatorphp-formphp-form-builderphp-forms

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[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)
