PHPackages                             marionnewlevant/twig-perversion - 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. marionnewlevant/twig-perversion

ActiveCraft-plugin[Templating &amp; Views](/categories/templating)

marionnewlevant/twig-perversion
===============================

Making twig do things it really shouldn't

5.0.1(1y ago)5466.1k↓31.7%7[1 issues](https://github.com/marionnewlevant/craft-twig_perversion/issues)[5 PRs](https://github.com/marionnewlevant/craft-twig_perversion/pulls)1MITPHPPHP &gt;=8.2

Since Oct 22Pushed 1y ago2 watchersCompare

[ Source](https://github.com/marionnewlevant/craft-twig_perversion)[ Packagist](https://packagist.org/packages/marionnewlevant/twig-perversion)[ RSS](/packages/marionnewlevant-twig-perversion/feed)WikiDiscussions v5 Synced 3d ago

READMEChangelog (10)Dependencies (2)Versions (16)Used By (1)

Twig Perversion plugin for Craft CMS
====================================

[](#twig-perversion-plugin-for-craft-cms)

Making twig do things it really shouldn't. Twig is not intended to be a general purpose programming language, and there are some things that really don't belong in the language. This plugin adds a few of those things anyway.

- `{% while %}`, `{% break %}`, `{% continue %}`, and `{% return %}` tags
- `===`, `!==`, and `` operators
- `is numeric`, `is string`, and `is array` tests
- `array_splice`, `string`, `float`, `int`, and `bool` filters

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 4.12 or later.

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

[](#installation)

1. Install with Composer via `composer require marionnewlevant/twig-perversion` from your project directory
2. Install plugin in the Craft Control Panel under Settings &gt; Plugins

or

1. Install via the [Plugin Store](https://plugins.craftcms.com/twig-perversion)

Using Twig Perversion
---------------------

[](#using-twig-perversion)

### Tags

[](#tags)

- `{% while %}` loop:

    ```
    {% set x = 0 %}
    {% while x
