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 3w 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 36% 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

3948d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13899502?v=4)[tourze](/maintainers/tourze)[@tourze](https://github.com/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

22149.2M204](/packages/twig-string-extra)[twig/markdown-extra

A Twig extension for Markdown

12115.5M117](/packages/twig-markdown-extra)[twig/intl-extra

A Twig extension for Intl

36667.2M319](/packages/twig-intl-extra)[symfony/ux-twig-component

Twig components for Symfony

21917.2M308](/packages/symfony-ux-twig-component)[symfony/ux-live-component

Live components for Symfony

1636.5M114](/packages/symfony-ux-live-component)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

22919.7M81](/packages/twig-cssinliner-extra)

PHPackages © 2026

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