PHPackages                             techwilk/twig-slim-csrf - 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. techwilk/twig-slim-csrf

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

techwilk/twig-slim-csrf
=======================

TWIG extension to expose Slim CSRF values in templates.

v1.0.2(8y ago)12.6k↓100%MITPHP

Since Dec 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/TechWilk/twig-slim-csrf)[ Packagist](https://packagist.org/packages/techwilk/twig-slim-csrf)[ Docs](https://github.com/TechWilk/twig-slim-csrf)[ RSS](/packages/techwilk-twig-slim-csrf/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Slim CSRF (extension for TWIG)
==============================

[](#slim-csrf-extension-for-twig)

[![Total Downloads](https://camo.githubusercontent.com/b41adffa28e4fe3cf577fddb68f7f36d85314fa7e88365f3fe4df88c153cddcd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7465636877696c6b2f747769672d736c696d2d637372662e737667)](https://packagist.org/packages/techwilk/twig-slim-csrf)[![Latest Stable Version](https://camo.githubusercontent.com/664b8c6a4b34d8a95d5134090c9bad87453ce45e5b7f053e6fde293b64b98280/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7465636877696c6b2f747769672d736c696d2d637372662e737667)](https://packagist.org/packages/techwilk/twig-slim-csrf)[![License](https://camo.githubusercontent.com/06be48e612232875a663126aaf8ae71821d0a769daddb9f24a35b87e39f3637a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7465636877696c6b2f747769672d736c696d2d637372662e737667)](https://packagist.org/packages/techwilk/twig-slim-csrf)

TWIG extension to expose Slim CSRF values in templates. Initially copied from the example in the [Slim CSRF readme](https://github.com/slimphp/Slim-Csrf) to this repo to allow installation through composer, though modifications may have since been made.

Installation
------------

[](#installation)

1. Install through composer.

```
composer require techwilk/twig-slim-csrf

```

2. Then pass in an instance of `\Slim\Csrf\Guard`:

```
$guard = new \Slim\Csrf\Guard();
$slimCsrf = new \TechWilk\Twig\Extension\SlimCsrf($guard);
$twig->addExtension($slimCsrf);
```

Use
---

[](#use)

Use as a standard twig properties:

```

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Total

3

Last Release

3072d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/630c7cca789fec1f035462272bbbb34fc2b584d9804c4783e64086541c3a9136?d=identicon)[TechWilk](/maintainers/TechWilk)

---

Top Contributors

[![TechWilk](https://avatars.githubusercontent.com/u/9367803?v=4)](https://github.com/TechWilk "TechWilk (3 commits)")

---

Tags

twigkeyextensioncsrfvalueglobals

### Embed Badge

![Health badge](/badges/techwilk-twig-slim-csrf/health.svg)

```
[![Health](https://phpackages.com/badges/techwilk-twig-slim-csrf/health.svg)](https://phpackages.com/packages/techwilk-twig-slim-csrf)
```

###  Alternatives

[shoot/shoot

Shoot aims to make providing data to your templates more manageable

41229.9k2](/packages/shoot-shoot)[redant/twig-components

Define reusable components in Twig.

3819.8k1](/packages/redant-twig-components)[umanit/twig-image-extension

An extension to facilitate the integration of responsive images' markup in Twig templates.

1042.2k](/packages/umanit-twig-image-extension)

PHPackages © 2026

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