PHPackages                             contenir/formbuilder - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. contenir/formbuilder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

contenir/formbuilder
====================

Framework-agnostic form-builder engine for Contenir CMS — runtime-editable form definitions, builder-form construction, server-side submission validation.

v0.1.4(1mo ago)0251MITPHPPHP ^8.1 || ^8.2 || ^8.3

Since May 10Pushed 1mo agoCompare

[ Source](https://github.com/contenir/formbuilder)[ Packagist](https://packagist.org/packages/contenir/formbuilder)[ RSS](/packages/contenir-formbuilder/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (8)Versions (6)Used By (1)

contenir/formbuilder
====================

[](#contenirformbuilder)

Framework-agnostic form-builder engine for [Contenir CMS](https://github.com/contenir).

Provides the runtime-editable form-definition value objects, the registry of field types, the curated validator vocabulary, the conditional-visibility rule engine, and the build/submit services that turn a stored definition into a working `Laminas\Form\Form` and a validated submission.

This package is the pure-PHP core. It has no opinion about how form definitions are loaded (DB, JSON, hardcoded array — bring your own loader) or how submissions are stored (registrar pattern). Adapter packages such as `contenir/formbuilder-laminas-mvc` wire it into a host framework.

Install
-------

[](#install)

```
composer require contenir/formbuilder
```

Optional but commonly paired:

- [`contenir/storage`](https://github.com/contenir/storage) — required for the `file` field type, passed in to `FormSubmissionService`.

Layout
------

[](#layout)

```
src/
├── Definition/   value objects: FormDefinition, SectionDefinition,
│                 GroupDefinition, RowDefinition, FieldDefinition,
│                 ValidatorDefinition, NotificationDefinition,
│                 WebhookDefinition
├── FieldType/    FieldTypeRegistry + FieldTypeInterface + 17 built-in
│                 types (text, email, url, tel, number, date, time,
│                 datetime, select, multiselect, radio, checkbox,
│                 multicheckbox, textarea, file, hidden, content)
├── Validator/    ValidatorFactory — curated vocabulary mapping onto
│                 Laminas validators (StringLength, Between, Hostname,
│                 Regex, Identical, EmailAddress)
├── Conditional/  RuleEvaluator + ConditionalRulesParser
└── Service/      FormBuilderService, FormSubmissionService,
                  TokenReplacer, BuilderForm, SubmissionResult

```

Usage
-----

[](#usage)

```
use Contenir\FormBuilder\Definition\FormDefinition;
use Contenir\FormBuilder\FieldType\FieldTypeRegistry;
use Contenir\FormBuilder\Service\FormBuilderService;
use Contenir\FormBuilder\Service\FormSubmissionService;
use Contenir\FormBuilder\Validator\ValidatorFactory;

$registry = new FieldTypeRegistry();
$validators = new ValidatorFactory();

$builder = new FormBuilderService($registry, $validators);
$form    = $builder->build($definition);  // Laminas\Form\Form

$service = new FormSubmissionService($builder);
$service->attach($yourPersistenceObserver);
$result = $service->submit($definition, $_POST, $_FILES, [
    'ip'      => $_SERVER['REMOTE_ADDR'] ?? null,
    'user_id' => null,
    'meta'    => [],
]);
```

License
-------

[](#license)

MIT.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance94

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

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

Total

5

Last Release

30d ago

### Community

Maintainers

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

---

Top Contributors

[![simon-mundy](https://avatars.githubusercontent.com/u/46739456?v=4)](https://github.com/simon-mundy "simon-mundy (5 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/contenir-formbuilder/health.svg)

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

###  Alternatives

[magento/community-edition

Magento 2 (Open Source)

12.1k53.0k12](/packages/magento-community-edition)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

562565.8k41](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

744284.3k34](/packages/civicrm-civicrm-core)

PHPackages © 2026

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