PHPackages                             pugx/formable - 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. pugx/formable

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

pugx/formable
=============

The PUGX Symfony Form Generator

v0.2(10y ago)112.7k1MITPHPPHP &gt;=5.4

Since May 27Pushed 1y ago9 watchersCompare

[ Source](https://github.com/PUGX/formable)[ Packagist](https://packagist.org/packages/pugx/formable)[ RSS](/packages/pugx-formable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (4)Used By (0)

Formable Symfony Bundle
=======================

[](#formable-symfony-bundle)

[![Build](https://camo.githubusercontent.com/2934733d072524b8232e2e564853a249413dd281c3088bdf79a3c6e3e5051c1c/68747470733a2f2f7472617669732d63692e6f72672f505547582f666f726d61626c652e737667)](https://camo.githubusercontent.com/2934733d072524b8232e2e564853a249413dd281c3088bdf79a3c6e3e5051c1c/68747470733a2f2f7472617669732d63692e6f72672f505547582f666f726d61626c652e737667)[![Latest Stable Version](https://camo.githubusercontent.com/281940b3e5f22dd9aa5b44a2449b4c8b717c8e31fde21a6e2f368e798415c80f/68747470733a2f2f706f7365722e707567782e6f72672f707567782f666f726d61626c652f762f737461626c65)](https://packagist.org/packages/pugx/formable) [![Total Downloads](https://camo.githubusercontent.com/bb3e4802a8d668cf6eecc7d60feb400dfa1b555aa57d7bf55dee915c76c09efb/68747470733a2f2f706f7365722e707567782e6f72672f707567782f666f726d61626c652f646f776e6c6f616473)](https://packagist.org/packages/pugx/formable) [![Latest Unstable Version](https://camo.githubusercontent.com/9f3abfbb41b085c5e100870fb09b37d32506f5422f1cef218385f2dceea2c432/68747470733a2f2f706f7365722e707567782e6f72672f707567782f666f726d61626c652f762f756e737461626c65)](https://packagist.org/packages/pugx/formable) [![License](https://camo.githubusercontent.com/ee1a027bdc6e28946497980270005ae139d1981e2fd384cc07871b2771a6852e/68747470733a2f2f706f7365722e707567782e6f72672f707567782f666f726d61626c652f6c6963656e7365)](https://packagist.org/packages/pugx/formable)

Why?
====

[](#why)

Because the cleanest way to transfer data from a web request to the domain is by using DTOs. For simple DTOs Symfony forces you to create 2 classes, the `FormType` class and the `SomethingDTO` class.

How?
====

[](#how)

This Bundle allows you to describe DTOs by the annotation `@Formable()`. Let's see an example.

Example
-------

[](#example)

### The Data Transfer Object

[](#the-data-transfer-object)

```
use Formable\Definition\Formable;
use Symfony\Component\Validator\Constraints as Assert;

class PublishPostCommand
{
    /**
     * @Formable(name="title", dataType="text")
     *
     * @Assert\Length(max=250)
     */
    public $title;

    /**
     * @Formable(name="content", dataType="text")
     */
    public $content;

    /**
     * @Formable(name="tags", dataType="collection", options={
     *   "type"="text",
     *   "allow_add"=true
     * })
     *
     * @Assert\Count(
     *   min = "2"
     * )
     *
     */
    public $tags;

    /**
     * @Formable(name="date", dataType="date", options={
     *   "widget"="single_text",
     *   "format"="yyyy-M-d"
     * })
     */
    public $date;
}
```

### Embedded DTOs

[](#embedded-dtos)

```
    /**
     * @var
     *
     * @Formable(name="moneyDTO", class="Formable\Tests\Integration\DTOs\TestMoneyDTO")
     */
    public $moneyDTO;
```

### The Controller

[](#the-controller)

```
public function publishAction(Request $request)
{
    $publishCommand = new PublishPostCommand();
    $publishCommand->date = new \DateTime('now');

    $form = $this->get('pugx.formable')->generate($publishCommand);
    $form->submit($request->request->all(), false /* Do not clear missing data */);

    if ($form->isValid()) {
        ...
    }
}
```

The annotation in depth
-----------------------

[](#the-annotation-in-depth)

The `@Formable()` annotation follows the `Symfony\Component\Form\FormBuilderInterface` interface.

**ARGUMENTS**:

- **name**: \[*string*\] the field name
- **dataType**: \[*string*\] the [FormType](http://symfony.com/doc/current/reference/forms/types.html)
- **options**: \[*array*\] the FormType options

```
    /**
     * @Formable(name="date", dataType="date", options={
     *   "format"= "yyyy-MM-dd",
     *   "days" = {1,2,3,4}
     * })
     */
    public $date;
```

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

[](#installation)

`composer require pugx/formable`

```
// Register the Bundle

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new \Formable\Bundle\FormableBundle(),
        );

        return $bundles;
    }

}
```

Run tests
---------

[](#run-tests)

`bin/test`

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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 ~49 days

Total

2

Last Release

3960d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/446a646f719434553ab25f0f931d28ec09fbb036528126ac7e9d54a2e8132581?d=identicon)[liuggio](/maintainers/liuggio)

![](https://www.gravatar.com/avatar/97e5b23c6d1b7bd92d3ab1b3219515ab17cb504562b76e8694be6238470b87c1?d=identicon)[toretto460](/maintainers/toretto460)

---

Top Contributors

[![simodima](https://avatars.githubusercontent.com/u/1193857?v=4)](https://github.com/simodima "simodima (28 commits)")[![lucagiacalone85](https://avatars.githubusercontent.com/u/3997565?v=4)](https://github.com/lucagiacalone85 "lucagiacalone85 (2 commits)")[![cirpo](https://avatars.githubusercontent.com/u/51252?v=4)](https://github.com/cirpo "cirpo (1 commits)")[![liuggio](https://avatars.githubusercontent.com/u/530406?v=4)](https://github.com/liuggio "liuggio (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pugx-formable/health.svg)

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

###  Alternatives

[wallabag/wallabag

open source self hostable read-it-later web application

12.6k2.2k](/packages/wallabag-wallabag)[jbtronics/settings-bundle

A symfony bundle to easily create typesafe, user-configurable settings for symfony applications

9546.7k2](/packages/jbtronics-settings-bundle)[pixelopen/cloudflare-turnstile-bundle

A simple package to help integrate Cloudflare Turnstile on Symfony.

31205.8k3](/packages/pixelopen-cloudflare-turnstile-bundle)[barryvdh/laravel-form-bridge

This packages integrates Symfony Form Component in Laravel.

163354.8k1](/packages/barryvdh-laravel-form-bridge)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

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