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

ActiveContao-bundle[Templating &amp; Views](/categories/templating)

netzmacht/contao-form-bundle
============================

Form bundle for using symfony forms with Contao CMS

2.0.2(11mo ago)71.4k3[2 PRs](https://github.com/netzmacht/contao-form-bundle/pulls)2LGPL-3.0-or-laterPHPPHP ^8.2CI failing

Since Feb 5Pushed 11mo ago3 watchersCompare

[ Source](https://github.com/netzmacht/contao-form-bundle)[ Packagist](https://packagist.org/packages/netzmacht/contao-form-bundle)[ GitHub Sponsors](https://github.com/dmolineus)[ RSS](/packages/netzmacht-contao-form-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (19)Versions (17)Used By (2)

Netzmacht Contao Form Bundle
============================

[](#netzmacht-contao-form-bundle)

This bundle enables the power of Symfony forms in your Contao project.

The purpose if not (yet) to provide a fully replacement of Contao Core form handling but to enable you to use form configurations (form generator, data containers) in your application.

Features
--------

[](#features)

- Enables the symfony form component in your application
- Provides a FormGeneratorType to use form based on the backend
- Provides a HtmlType to add plain html to a form
- Provides a backend form theme
- Adds option for the widget allowing to define `class`, `fe_class`, `be_class` css attributes

### Form generator

[](#form-generator)

If you want to use the form generator to configure your symfony forms - you can do it. This extension ships a FromGeneratorType.

**Usage**

```
// Symfony form generator, provided as service form.factory
$form = $formFactory->create(Netzmacht\ContaoFormBundle\Form\FormGeneratorType::class, null, ['formId' => 5]);

// That's all. Now you can use a symfon form having your form generator form fields.
```

### DCA forms

[](#dca-forms)

If you want to create forms based on the data container arrays - you can do it. The extension ships a DcaFormType.

**Usage**

```
// Symfony form generator, provided as service form.factory
assert($dc instanceof Contao\DataContainer);
$form = $formFactory->create(
    Netzmacht\ContaoFormBundle\Form\DcaFormType::class,
    null,
    ['dataContainer' => 'tl_content', 'fields' => ['text'], 'driver' => $dc]
);
```

**Warning** The support for dca forms is experimental and might have some unforseen issues. It's highly recommended to pass the data container driver as callbacks might need them. Following types are supported so far:

- `checkbox`
- `password`
- `radio`
- `select`
- `text`
- `textarea`

### Backend form theme

[](#backend-form-theme)

This bundle also provides a form theme for the Contao backend. You can enable it in your twig template where the form is used:

```
{% form_theme form '@NetzmachtContaoForm/form/contao_backend.html.twig' %}
{{ form(form) }}
```

### CSS attributes

[](#css-attributes)

Inside the form theme you can use additional classes to add specific styles, this is done by the `contaoWidget` option inside a FormType, there is a generic key `class` and context specific keys for frontend `fe_class` and backend `be_class`:

```
$builder
    ->add(
        'field',
        FieldType::class,
        [
            'contaoWidget' => ['class' => 'generic-class', 'be_class' => 'clr w50', 'fe_class' => 'frontend-class'],
        ]
    )
```

### Input filtering

[](#input-filtering)

Be aware that the **Contao input sanitizing is bypassed by default**. If you need the data filtered, especially when using it in legacy context (f.e. Contao templates) you can filter the data by using the provided input filter `Netzmacht\ContaoFormBundle\Filter\ContaoInputFilter` which is provided as service `netzmacht.contao_form.input_filter`.

### Upload handler

[](#upload-handler)

By default the uploaded file is available as `UploadedFile` instance in the form data. If you want to apply the configured setting form the form field, you might use the `Netzmacht\ContaoFormBundle\Form\FormGenerator\UploadHandler`class provided as service `netzmacht.contao_form.form_generator.upload_handler`.

Roadmap
-------

[](#roadmap)

- Support popular 3rd party form fields

Known limitations
-----------------

[](#known-limitations)

- Unsupported form fields are just ignored (form generator)
- Submit buttons with images are not supported.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance50

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 94.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 ~192 days

Recently: every ~397 days

Total

13

Last Release

351d ago

Major Versions

1.4.0 → 2.0.02022-08-17

PHP version history (4 changes)1.0.0PHP ^7.1

1.4.0PHP ^7.1 || ^8.0

2.0.0PHP ^7.4 || ^8.0

2.0.1PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8189209?v=4)[netzmacht](/maintainers/netzmacht)[@netzmacht](https://github.com/netzmacht)

---

Top Contributors

[![dmolineus](https://avatars.githubusercontent.com/u/1186266?v=4)](https://github.com/dmolineus "dmolineus (137 commits)")[![bezin](https://avatars.githubusercontent.com/u/4400435?v=4)](https://github.com/bezin "bezin (5 commits)")[![cboelter](https://avatars.githubusercontent.com/u/550207?v=4)](https://github.com/cboelter "cboelter (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

contaocontao-bundlesymfony-formscontaoForms

### Embed Badge

![Health badge](/badges/netzmacht-contao-form-bundle/health.svg)

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

###  Alternatives

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[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)[sulu/sulu

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

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

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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