PHPackages                             hum2/twig-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. hum2/twig-form

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

hum2/twig-form
==============

Form Extension for Twig.

0.1.5(10y ago)16.4k1MITPHPPHP &gt;=5.2.4

Since Jun 30Pushed 10y ago1 watchersCompare

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

READMEChangelog (6)Dependencies (3)Versions (7)Used By (1)

Form Extension for Twig
=======================

[](#form-extension-for-twig)

[![Build Status](https://camo.githubusercontent.com/e386ca97e45466ed9f9bf12e8f76a3fdee03dd9086337e45e5d8fee7208f350a/68747470733a2f2f7472617669732d63692e6f72672f68756d322f747769672d666f726d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hum2/twig-form)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/fe0940884871d614ac7ba12670eccd036c69fc6ade5202bc9105199fda964ebd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68756d322f747769672d666f726d2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/hum2/twig-form/?branch=master)

[![Latest Stable Version](https://camo.githubusercontent.com/086c8f1795405184fc30434b4c633d7d7074bb3de0b89bc54ecf684ab875687d/68747470733a2f2f706f7365722e707567782e6f72672f68756d322f747769672d666f726d2f762f737461626c65)](https://packagist.org/packages/hum2/twig-form)[![Total Downloads](https://camo.githubusercontent.com/5661cd68c5c61e4795c2e210b5cce29c7f1d9ba0b45f221e3e5aa6a6dc39fc34/68747470733a2f2f706f7365722e707567782e6f72672f68756d322f747769672d666f726d2f646f776e6c6f616473)](https://packagist.org/packages/hum2/twig-form)[![Latest Unstable Version](https://camo.githubusercontent.com/650203aecdaa502ae050d7f6862df09f72b0eef4b2424973b0de462300c71ec0/68747470733a2f2f706f7365722e707567782e6f72672f68756d322f747769672d666f726d2f762f756e737461626c65)](https://packagist.org/packages/hum2/twig-form)[![License](https://camo.githubusercontent.com/7109617a3561b44f582f6931d5ef625feb1f5c0b879d8148c3863f738b386e10/68747470733a2f2f706f7365722e707567782e6f72672f68756d322f747769672d666f726d2f6c6963656e7365)](https://packagist.org/packages/hum2/twig-form)

install
-------

[](#install)

```
composer require hum2/twig-form
```

How To Use
----------

[](#how-to-use)

### index.html.twig

[](#indexhtmltwig)

```
{% form(action=post_url|e, method="POST", enctype="multipart/form-data") %}

{% endform %}
```

### index.php

[](#indexphp)

```
# validate
$factory   = new \Aura\Session\SessionFactory;
$session   = $factory->newInstance($_COOKIE);

$actualToken = $_POST['__csrf_value'];
if (!$session->getCsrfToken()->isValid($actualToken)) {
	// csrf token error
}
// regenerate token(should be onetime token)
$session->getCsrfToken()->regenerateValue();
```

dependency Package
------------------

[](#dependency-package)

- twig/twig
- aura/session

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

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

Total

5

Last Release

3940d ago

### Community

Maintainers

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

---

Top Contributors

[![hum2](https://avatars.githubusercontent.com/u/9448804?v=4)](https://github.com/hum2 "hum2 (23 commits)")

---

Tags

twigform

### Embed Badge

![Health badge](/badges/hum2-twig-form/health.svg)

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

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91492.0M315](/packages/twig-extra-bundle)[twig/intl-extra

A Twig extension for Intl

36763.2M221](/packages/twig-intl-extra)[rcrowe/twigbridge

Adds the power of Twig to Laravel

9105.9M50](/packages/rcrowe-twigbridge)[twig/string-extra

A Twig extension for Symfony String

22046.0M133](/packages/twig-string-extra)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

22918.5M55](/packages/twig-cssinliner-extra)[symfony/ux-twig-component

Twig components for Symfony

21914.8M162](/packages/symfony-ux-twig-component)

PHPackages © 2026

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