PHPackages                             zikula/dynamic-form-bundle - 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. [Database &amp; ORM](/categories/database)
4. /
5. zikula/dynamic-form-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

zikula/dynamic-form-bundle
==========================

A Symfony bundle providing helpers for dynamic forms.

v1.0.1(2y ago)3476[3 issues](https://github.com/zikula/DynamicFormBundle/issues)MITPHPPHP ^7.4 || ^8.0CI failing

Since Jun 19Pushed 3mo ago5 watchersCompare

[ Source](https://github.com/zikula/DynamicFormBundle)[ Packagist](https://packagist.org/packages/zikula/dynamic-form-bundle)[ Docs](https://github.com/zikula/DynamicFormBundle)[ GitHub Sponsors](https://github.com/craigh)[ RSS](/packages/zikula-dynamic-form-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (17)Versions (3)Used By (0)

DynamicFormBundle
=================

[](#dynamicformbundle)

[![Build Status](https://camo.githubusercontent.com/8956c670c88f6f6e99a9f128b159433d324a0d2ec57b279d1fccb7ffda808dd2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7a696b756c612f44796e616d6963466f726d42756e646c652f53796d666f6e79)](https://camo.githubusercontent.com/8956c670c88f6f6e99a9f128b159433d324a0d2ec57b279d1fccb7ffda808dd2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7a696b756c612f44796e616d6963466f726d42756e646c652f53796d666f6e79)[![codecov](https://camo.githubusercontent.com/18d46e5849d0604a52bfd538c31e0a87237bd8b736eef0352a529c79911f87bd/68747470733a2f2f636f6465636f762e696f2f67682f7a696b756c612f44796e616d6963466f726d42756e646c652f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d3942494c33455135494b)](https://codecov.io/gh/zikula/DynamicFormBundle)[![License](https://camo.githubusercontent.com/d094cda64d83a4e9b28b94fb1e57522630b67b128390840939a680571e62ee68/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7a696b756c612f44796e616d6963466f726d42756e646c65)](https://camo.githubusercontent.com/d094cda64d83a4e9b28b94fb1e57522630b67b128390840939a680571e62ee68/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7a696b756c612f44796e616d6963466f726d42756e646c65)

The `DynamicFormBundle` offers helpers for handling dynamic form fields (forms built from definitions stored in the database). This can be helpful for several applications where a site admin (not the developer) needs to configure the fields of a form, like contact forms, surveys or exams, employment applications, etc.

#### [An example SurveyMaker application is available](https://github.com/zikula/DynamicFormBundleExample).

[](#an-example-surveymaker-application-is-available)

Installation
============

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Applications that use Symfony Flex
----------------------------------

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
$ composer require zikula/dynamic-form-bundle
```

Applications that don't use Symfony Flex
----------------------------------------

[](#applications-that-dont-use-symfony-flex)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require zikula/dynamic-form-bundle
```

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    Zikula\Bundle\DynamicFormBundle\ZikulaDynamicFormBundle::class => ['all' => true],
];
```

Getting Started
---------------

[](#getting-started)

In order to implement this bundle, the developer must create three entities:

1. A 'container' Entity that holds both:
    1. The form specifications (OneToMany)
    2. The response data (OneToMany)
    3. This *may* extend `AbstractSpecificationContainer`
2. A 'wrapper' Entity that defines the form specification.
    1. This **must** extend `AbstractFormSpecification`
3. A 'response' Entity to contain the data responses to the forms.
    1. This **must** extend `AbstractResponseData`

Form Creation: the 'Building' form
----------------------------------

[](#form-creation-the-building-form)

The `Zikula\Bundle\DynamicFormBundle\Form\Type\FormSpecificationCollectionType` formType is a collection of Form Specifications in your form. You must define the `entry_type` to be your own 'wrapper' Entity (item 2 above). Each member of the collection provides a form type to define all the needed details of a formType (a `FormSpecification`). Form options are loaded using ajax and dynamically added/replaced in the form.

```
    $builder
        ->add('questions', FormSpecificationCollectionType::class, [
            'entry_options' => [
                'data_class' => Question::class // required
            ],
        ])
```

**IMPORTANT NOTE**: The Javascript for these actions is automatically loaded. However, the javascript is jQuery-based. Therefore, **you must include jQuery in your front-end assets.**

Form Creation: The 'Responding' form
------------------------------------

[](#form-creation-the-responding-form)

The bundle also provides the `Zikula\Bundle\DynamicFormBundle\Form\Type\DynamicFieldsType` formType. This provides for inclusion of the defined dynamic fields. The formType requires the `specificationContainer` object. This object implements `Zikula\Bundle\DynamicFormBundle\Container\SpecificationContainerInterface`. This can be your 'Container' object (item 1 above) or possibly another provider like a Repository. The object must provide a list of form specifications (as defined by the 'wrapper' class). This list can be optionally sorted or filtered as required.

Example:

```
    $builder->add('survey', DynamicFieldsType::class, [
        'specificationContainer' => $myContainer,
    ]);
```

### More information

[](#more-information)

- see [Additional Documentation](docs/index.md)
- This bundle suggests [scienta/doctrine-json-functions](https://github.com/ScientaNL/DoctrineJsonFunctions)
    - You must configure the DoctrineJsonFunctions bundle at the application level. It is not done automatically.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97% 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 ~453 days

Total

2

Last Release

976d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/05bffe6f4f72d34970f0d8f6682b283bd19fbe8c2b2cc7eda48867a3a7f3db4c?d=identicon)[zikula](/maintainers/zikula)

---

Top Contributors

[![craigh](https://avatars.githubusercontent.com/u/350048?v=4)](https://github.com/craigh "craigh (97 commits)")[![Guite](https://avatars.githubusercontent.com/u/277531?v=4)](https://github.com/Guite "Guite (2 commits)")[![On5-Repos](https://avatars.githubusercontent.com/u/46661426?v=4)](https://github.com/On5-Repos "On5-Repos (1 commits)")

---

Tags

bundledoctrinedynamicformform-builderform-generatorform-makerformsphpsymfonysymfony-bundle

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/zikula-dynamic-form-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/zikula-dynamic-form-bundle/health.svg)](https://phpackages.com/packages/zikula-dynamic-form-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

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