PHPackages                             macwinnie/twigbundle-form - 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. macwinnie/twigbundle-form

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

macwinnie/twigbundle-form
=========================

A Twig Bundle providing some helper templating for forms

1.0.5(1y ago)090MITPHP

Since Jan 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/macwinnie/twigbundle-form)[ Packagist](https://packagist.org/packages/macwinnie/twigbundle-form)[ RSS](/packages/macwinnie-twigbundle-form/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Form helpers – TWIG
===================

[](#form-helpers--twig)

This [Twig Bundle](https://github.com/nystudio107/twig-bundle-installer) allows to reuse some helpful Form elements ... as [Twig Macros](https://twig.symfony.com/doc/3.x/tags/macro.html).

**WARNING:** as always when working with forms ... the view isn't the (only) place to verify if a user is allowed to send specific information ... if you disable a form element or make it read only in the view, you also want to prove the data sent does not contain that specific value changed!

Data structures
---------------

[](#data-structures)

As always, a template is using a dedicated data structure to be transferred into a view ... So the following section is on how the data has to be structured for the usage of the provided macros:

### Form

[](#form)

The `form` macro is using a Bootstrap-DIV-based layout and can be adapted easily. To use it, you'll want to require the `\macwinnie\TwigbundleForm\FormExtension` class as Twig extension:

```
```

### Form Element

[](#form-element)

By default, if none of the following options is selected, we'll get a `` field rendered by this macro. If

Example usage
-------------

[](#example-usage)

This is an example of a Twig template on how to build forms and a single form element:

```
Form-Testing

{% set form_data = {
    "create":
    {
        "action": "/tests/helper/?"
    },
    "buttons":
    [
        {
            "text": "submit",
            "class": "btn btn-primary",
            "name": "submitbutton",
            "value": "submit_val"
        }
    ],
    "rows":
    [
        {
            "name": "text",
            "placeholder": "ph text",
            "type": "text",
            "title": "single line textfield"
        }
    ]
} %}

{% import "form.twig" as forms %}
{% import "formelement.twig" as formelement %}

{{ forms.create( form_data ) }}

{{ formelement.create( form_data.rows[0] ) }}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance49

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Total

5

Last Release

374d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/06148942cbb815f08bd44856cdc26cc63446ef01adf1f207100ae76965c017d6?d=identicon)[macwinnie](/maintainers/macwinnie)

---

Top Contributors

[![macwinnie](https://avatars.githubusercontent.com/u/1001936?v=4)](https://github.com/macwinnie "macwinnie (7 commits)")

---

Tags

composerbundletwiginstallerformtwig-bundle

### Embed Badge

![Health badge](/badges/macwinnie-twigbundle-form/health.svg)

```
[![Health](https://phpackages.com/badges/macwinnie-twigbundle-form/health.svg)](https://phpackages.com/packages/macwinnie-twigbundle-form)
```

###  Alternatives

[nucleos/antispam-bundle

This bundle provides some basic features to reduce spam in symfony forms.

52105.1k](/packages/nucleos-antispam-bundle)[nystudio107/twig-bundle-installer

Install, update, and manage Twig template bundles via Composer

361.1k1](/packages/nystudio107-twig-bundle-installer)[boekkooi/jquery-validation-bundle

Jquery form validation bundle for symfony 2

2773.9k1](/packages/boekkooi-jquery-validation-bundle)[ex3v/formerrorsbundle

A service and Twig method that displays all form errors on all levels.

118.8k](/packages/ex3v-formerrorsbundle)[nurikabe/star-rating-bundle

Symfony form type and Twig extension for quick integration of FyneWorks' Star Rating widget

113.1k](/packages/nurikabe-star-rating-bundle)

PHPackages © 2026

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