PHPackages                             bpolaszek/formmetadatabundle - 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. bpolaszek/formmetadatabundle

ActiveLibrary

bpolaszek/formmetadatabundle
============================

0.4(10y ago)0861PHPPHP &gt;=5.4

Since Oct 20Pushed 10y ago1 watchersCompare

[ Source](https://github.com/bpolaszek/FormMetadataBundle)[ Packagist](https://packagist.org/packages/bpolaszek/formmetadatabundle)[ Docs](https://github.com/bpolaszek/formmetadatabundle)[ RSS](/packages/bpolaszek-formmetadatabundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (9)Used By (0)

Form Metadata reader for Symfony2
=================================

[](#form-metadata-reader-for-symfony2)

Facilitates the basic configuration of form fields from metadata that is defined elsewhere, such as through annotations in the entity or with an external yaml file (TODO). Allows for more generic handling of form types through controllers, making them able to deal with dynamic entity/forms (such as for use with CMS sites).

See the form fields [Annotations Reference](https://github.com/FlintLabs/FormMetadataBundle/wiki/Annotations-reference)

Note: People may want to consider the use of Symfony2 Abstract Forms to configure their forms external to the controller as a best practice.

Annotations Example
-------------------

[](#annotations-example)

**Standard form builder**

```
->add('dueDate', 'date', array('widget' => 'single_text'))

```

**Using annotations in your entity**

```
/**
 * @Form\Field("date", widget="single_text")
 */

```

### Entity with some basic form annotations

[](#entity-with-some-basic-form-annotations)

```
use FlintLabs\Bundle\FormMetadataBundle\Configuration as Form;
use Symfony\Bundle\Validator\Constraints as Assert;

class Contact
{
    /**
     * @Form\Field("text")
     * @Assert\NotBlank()
     */
    public $name;

    /**
     * @Form\Field("textarea")
     */
    public $message;
}

```

### Simple controller

[](#simple-controller)

```
class MyController
{
    public function contactAction()
    {
        $contact = new Contact();
        $form = $this->get('form_metadata.mapper')->createFormBuilder($contact)->getForm();

        if ($request->getMethod() == 'POST') {
            $form->bindRequest($request);

            if ($form->isValid()) {
                // perform some action, such as saving the task to the database
                return $this->redirect($this->generateUrl('task_success'));
            }
        }
    }
}

```

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

[](#installation)

### Update your deps file

[](#update-your-deps-file)

```
[Form-Metadata]
    git=git@github.com:FlintLabs/Form-Metadata.git
    target=/bundles/FlintLabs/Bundle/FormMetadataBundle

```

### Update your vendors

[](#update-your-vendors)

```
php bin/vendors update

```

### Update your autoloader

[](#update-your-autoloader)

```
// app/autoload.php
$loader->registerNamespaces(array(
    // ...
    'FlintLabs\\Bundle\\FormMetadataBundle' => __DIR__.'/../vendor/bundles/',
    // ...
));

```

### Register the bundle references

[](#register-the-bundle-references)

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new FlintLabs\Bundle\FormMetadataBundle\FlintLabsFormMetadataBundle(),
        // ...
    );
}

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81% 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 ~14 days

Recently: every ~25 days

Total

8

Last Release

3753d ago

### Community

Maintainers

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

---

Top Contributors

[![cammanderson](https://avatars.githubusercontent.com/u/578846?v=4)](https://github.com/cammanderson "cammanderson (47 commits)")[![ben-synapse](https://avatars.githubusercontent.com/u/36077477?v=4)](https://github.com/ben-synapse "ben-synapse (9 commits)")[![bpolaszek](https://avatars.githubusercontent.com/u/5569077?v=4)](https://github.com/bpolaszek "bpolaszek (2 commits)")

### Embed Badge

![Health badge](/badges/bpolaszek-formmetadatabundle/health.svg)

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

PHPackages © 2026

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