PHPackages                             techwilk/twig-linewrap - 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-linewrap

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

techwilk/twig-linewrap
======================

TWIG filter to wrap lines exceeding the specified length.

v1.0(8y ago)03.2kMITPHP

Since Jul 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/TechWilk/twig-linewrap)[ Packagist](https://packagist.org/packages/techwilk/twig-linewrap)[ Docs](https://github.com/TechWilk/twig-linewrap)[ RSS](/packages/techwilk-twig-linewrap/feed)WikiDiscussions master Synced 2d ago

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

Line Wrap (filter for TWIG)
===========================

[](#line-wrap-filter-for-twig)

[![Total Downloads](https://camo.githubusercontent.com/ef0de7ee37de67c29b110feccf570f0dec3610868f97df6c082cb09441842ffd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7465636877696c6b2f747769672d6c696e65777261702e737667)](https://packagist.org/packages/techwilk/twig-linewrap)[![Latest Stable Version](https://camo.githubusercontent.com/870ae0437a06c5d9b1d57087e9ef64848eb04967594caa61d4af4a02e18d305e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7465636877696c6b2f747769672d6c696e65777261702e737667)](https://packagist.org/packages/techwilk/twig-linewrap)[![License](https://camo.githubusercontent.com/b718978f2f19a6f8dbfaa638f14e075e91aaa128b200494a5894f04f5230e16b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7465636877696c6b2f747769672d6c696e65777261702e737667)](https://packagist.org/packages/techwilk/twig-linewrap)

TWIG filter to wrap lines over a specified length with a newline, or optionally pass in a different separator.

Designed for wrapping iCal files to 75 chars max length, although should be useful in any application requiring line wrapping.

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

[](#installation)

1. Install through composer.

```
composer require techwilk/twig-linewrap

```

2. Then add as an extension to TWIG:

```
$twig->addExtension(new \TechWilk\Twig\Extension\LineWrap());
```

Use
---

[](#use)

Use as a standard twig filter, passing in a maximum length after which to wrap:

```
{{ 'this is some text that goes on forever' | linewrap(10) }}
```

outputs:

```
this is so
me text th
at goes on
 forever

```

Optionally pass in a different separator (such as for [iCal wrapping](examples/ical-wrapping.md)):

```
{{ 'this is some text that goes on forever' | linewrap(75, "\n ") }}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

3234d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9367803?v=4)[Christopher Wilkinson](/maintainers/TechWilk)[@TechWilk](https://github.com/TechWilk)

---

Top Contributors

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

---

Tags

twigfilterextensionicallinewrap

### Embed Badge

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

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

###  Alternatives

[redant/twig-components

Define reusable components in Twig.

3819.8k1](/packages/redant-twig-components)[gecko-packages/gecko-twig

Additional Twig filters and tests.

1113.0k](/packages/gecko-packages-gecko-twig)

PHPackages © 2026

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