PHPackages                             tourze/twig-html-helpers - 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. tourze/twig-html-helpers

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

tourze/twig-html-helpers
========================

Rails style view helpers for HTML tags in PHP Twig

1.0.0(10y ago)030MITPHPPHP &gt;=5.2.4

Since Sep 4Pushed 10y ago1 watchersCompare

[ Source](https://github.com/tourze/twig-html-helpers)[ Packagist](https://packagist.org/packages/tourze/twig-html-helpers)[ Docs](https://github.com/tourze/twig-html-helpers)[ RSS](/packages/tourze-twig-html-helpers/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (1)Used By (0)

Twig HTML Helpers Extension
===========================

[](#twig-html-helpers-extension)

This [PHP Twig](http://twig.sensiolabs.org) extension adds the following Rails style HTML helpers:

- `check_box_tag($name, $value = '1', $default = false, $options = array())`
- `content_tag($name, $content='', $options=array())`
- `hidden_field_tag($name, $default = null, $options = array())`
- `html_tag($name, $options=array())`
- `image_tag($src, $options=array())`
- `input_tag($type, $name, $value=null, $options=array())`
- `label_tag($name, $text = null, $options = array())`
- `labelled_text_field_tag($name, $default = null, $options = array())`
- `link_tag($title, $url=null, $options=array())`
- `password_field_tag($name = 'password', $default = null, $options = array())`
- `radio_button_tag($name, $value, $default = false, $options = array())`
- `reset_tag($value = 'Reset', $options = array())`
- `select_tag($name, $options, $default = null, $html_options = array())`
- `submit_tag($value = 'Submit', $options = array())`
- `text_area_tag($name, $default = null, $options = array())`
- `text_field_tag($name, $default = null, $options = array())`

To use them, first add the extension to your `composer.json`:

```
"require": {
    "njh/twig-html-helpers": "dev-master"
},

```

Then load it into your environment:

```
$twig = new Twig_Environment();
$twig->addExtension(new Twig_Extension_HTMLHelpers());

```

You can then use them in your Twig templates:

```
{{ link_tag('http://www.example.com/') }}

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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

Unknown

Total

1

Last Release

3901d ago

### Community

Maintainers

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

---

Top Contributors

[![njh](https://avatars.githubusercontent.com/u/38734?v=4)](https://github.com/njh "njh (22 commits)")[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (2 commits)")

---

Tags

twightmltag

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tourze-twig-html-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-twig-html-helpers/health.svg)](https://phpackages.com/packages/tourze-twig-html-helpers)
```

###  Alternatives

[twig/string-extra

A Twig extension for Symfony String

21946.0M132](/packages/twig-string-extra)[twig/markdown-extra

A Twig extension for Markdown

12114.3M83](/packages/twig-markdown-extra)[twig/html-extra

A Twig extension for HTML

777.6M41](/packages/twig-html-extra)[twig/cache-extra

A Twig extension for Symfony Cache

392.1M20](/packages/twig-cache-extra)[spress/spress

Static site generator with blogs support

37436.2k](/packages/spress-spress)[nochso/html-compress-twig

Twig extension for compressing HTML and inline CSS/Javascript

84468.6k8](/packages/nochso-html-compress-twig)

PHPackages © 2026

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