PHPackages                             trt/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. [Templating &amp; Views](/categories/templating)
4. /
5. trt/formable

Abandoned → [https://github.com/PUGX/formable](/?search=https%3A%2F%2Fgithub.com%2FPUGX%2Fformable)Bundle[Templating &amp; Views](/categories/templating)

trt/formable
============

The Symfony Form Generator

v0.1(11y ago)161.5k4[2 issues](https://github.com/toretto460/formable/issues)MITPHP

Since May 27Pushed 10y ago4 watchersCompare

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

READMEChangelogDependencies (5)Versions (3)Used By (0)

This package is abandoned and no longer maintained. The author suggests using the  package instead.
=====================================================================================================================================

[](#this-package-is-abandoned-and-no-longer-maintained-the-author-suggests-using-the-httpsgithubcompugxformable-package-instead)

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

[](#formable-symfony-bundle)

[![Latest Stable Version](https://camo.githubusercontent.com/4326bcae4f6daea03f361d08f15fec904817a4907c57490697521e17028eff7c/68747470733a2f2f706f7365722e707567782e6f72672f7472742f666f726d61626c652f762f737461626c65)](https://packagist.org/packages/trt/formable) [![Total Downloads](https://camo.githubusercontent.com/cbaf6037dbfe2c799d00ab42f4b31cc87ae0d19b0a16be591d009b4d9cbdd590/68747470733a2f2f706f7365722e707567782e6f72672f7472742f666f726d61626c652f646f776e6c6f616473)](https://packagist.org/packages/trt/formable) [![Latest Unstable Version](https://camo.githubusercontent.com/2726318bce89aed1f3f278938845519a636303890806d8338fcc75ff794b83f6/68747470733a2f2f706f7365722e707567782e6f72672f7472742f666f726d61626c652f762f756e737461626c65)](https://packagist.org/packages/trt/formable) [![License](https://camo.githubusercontent.com/b71063af5e112f29c4c3be850503d470bebd3c27d4128e71d6f980a4b3365099/68747470733a2f2f706f7365722e707567782e6f72672f7472742f666f726d61626c652f6c6963656e7365)](https://packagist.org/packages/trt/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('trt.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"= IntlDateFormatter::MEDIUM,
     *   "days" = {1,2,3,4}
     * })
     */
    public $date;
```

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

[](#installation)

`composer require trt/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

30

—

LowBetter than 62% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% 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

Unknown

Total

1

Last Release

4031d ago

### Community

Maintainers

![](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 (19 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/trt-formable/health.svg)

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M370](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)[kimai/kimai

Kimai - Time Tracking

4.7k8.7k1](/packages/kimai-kimai)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51090.8k2](/packages/web-auth-webauthn-framework)[web-auth/webauthn-symfony-bundle

FIDO2/Webauthn Security Bundle For Symfony

66474.5k8](/packages/web-auth-webauthn-symfony-bundle)[yceruto/formflow-bundle

Create and manage multistep forms

2414.8k](/packages/yceruto-formflow-bundle)

PHPackages © 2026

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