PHPackages                             lzakrzewski/symfony-form-generator - 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. lzakrzewski/symfony-form-generator

ActiveLibrary[Templating &amp; Views](/categories/templating)

lzakrzewski/symfony-form-generator
==================================

Generic solution to create forms "on the fly" basing on class metadata

0.0.3(10y ago)1601MITPHPPHP &gt;=5.5

Since Dec 8Pushed 10y ago1 watchersCompare

[ Source](https://github.com/lzakrzewski/SymfonyFormGenerator)[ Packagist](https://packagist.org/packages/lzakrzewski/symfony-form-generator)[ RSS](/packages/lzakrzewski-symfony-form-generator/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (9)Versions (4)Used By (1)

Symfony Form Generator [![Build Status](https://camo.githubusercontent.com/4856bc3779d33fd6faaf2b308d715ca6acac56089d1b2352d172ecf8544dc502/68747470733a2f2f7472617669732d63692e6f72672f6c7a616b727a6577736b692f53796d666f6e79466f726d47656e657261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/lzakrzewski/SymfonyFormGenerator) [![Coverage Status](https://camo.githubusercontent.com/4caf3643dc2b7b50a37ceb9860162293f049b73f609eb311d3b497544400365b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c7a616b727a6577736b692f53796d666f6e79466f726d47656e657261746f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/lzakrzewski/SymfonyFormGenerator?branch=master)
=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#symfony-form-generator--)

This package adds feature for generating `symfony` forms "on the fly" basing on class metadata like:

- `Form` annotations,
- type hints,
- phpdoc comments,
- validator annotations.

Created forms are able to submit with raw data (`boolean`, `integer`, `string`, `array`, `real`, `double`, `float`).

Example
-------

[](#example)

Object of given class:

```
use Lzakrzewski\SymfonyFormGenerator\Annotation\Form;
use Symfony\Component\Validator\Constraints as Assert;

class ObjectWithMixedMetadata
{
    /**
     * @var bool
     */
    public $propertyBoolean;

    /**
     * @Assert\Count(max="5")
     */
    public $propertyArray;

    /**
     * @Form\Field("integer", options={"label"="Property Integer"})
     */
    public $propertyInteger;

    public $propertyDateTime;

    public $propertyUndefined;

    public function __construct($propertyBoolean, $propertyArray, $propertyInteger, \DateTime $propertyDateTime, $propertyUndefined)
    {
        $this->propertyBoolean   = $propertyBoolean;
        $this->propertyArray     = $propertyArray;
        $this->propertyInteger   = $propertyInteger;
        $this->propertyDateTime  = $propertyDateTime;
        $this->propertyUndefined = $propertyUndefined;
    }
}
```

after:

```
$form = GeneratorFactory::createGenerator()
    ->generateFormBuilder(ObjectWithMixedMetadata::class)
    ->getForm();
```

will have `form` equivalent:

```
use Lzakrzewski\SymfonyFormGenerator\Form\Type\GeneratorFormType;
use Lzakrzewski\SymfonyFormGenerator\ObjectWithMixedMetadata;
use Symfony\Component\Form\Forms;

Forms::createFormFactory()->createBuilder()
    ->create('form', new GeneratorFormType(ObjectWithMixedMetadata::class))
    ->add('propertyBoolean', 'checkbox')
    ->add('propertyArray', 'generator_array')
    ->add('propertyInteger', 'integer')
    ->add('propertyDateTime', 'generator_datetime')
    ->add('propertyUndefined', 'generator_string');
```

`generator_array` type extends `collection`, `generator_datetime` type extends `datetime`, `generator_string` type extends `text`.

`generator_*` types are custom form types for better support raw values.

Documentation
-------------

[](#documentation)

Topics:

- [Installation](doc/installation.md)
- [Usage](doc/usage.md)
- [Supported value objects](doc/value_objects.md)
- [Guess priorities](doc/guess_priorities.md)
- [Form annotation guess](doc/form_annotation_guess.md)
- [PHPDoc comment guess](doc/phpdoc_comment_guess.md)
- [Validator guess](doc/validator_guess.md)
- [Type hint guess](doc/type_hint_guess.md)
- [Custom mapping](doc/custom_mapping.md)

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

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

Total

3

Last Release

3796d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4248462?v=4)[Łukasz Zakrzewski](/maintainers/lzakrzewski)[@lzakrzewski](https://github.com/lzakrzewski)

---

Top Contributors

[![lzakrzewski](https://avatars.githubusercontent.com/u/4248462?v=4)](https://github.com/lzakrzewski "lzakrzewski (115 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lzakrzewski-symfony-form-generator/health.svg)

```
[![Health](https://phpackages.com/badges/lzakrzewski-symfony-form-generator/health.svg)](https://phpackages.com/packages/lzakrzewski-symfony-form-generator)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[oro/platform

Business Application Platform (BAP)

642140.7k105](/packages/oro-platform)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51390.8k3](/packages/web-auth-webauthn-framework)[ec-cube/ec-cube

EC-CUBE EC open platform.

78727.2k1](/packages/ec-cube-ec-cube)[typo3/cms-extbase

TYPO3 CMS Extbase - Extension framework to create TYPO3 frontend plugins and TYPO3 backend modules.

1812.8M746](/packages/typo3-cms-extbase)

PHPackages © 2026

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