PHPackages                             pierredup/toggler - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. pierredup/toggler

Abandoned → [solidworx/toggler](/?search=solidworx%2Ftoggler)Library[Utility &amp; Helpers](/categories/utility)

pierredup/toggler
=================

Feature toggle library

1.2.0(10y ago)21163[2 issues](https://github.com/pierredup/toggler/issues)[2 PRs](https://github.com/pierredup/toggler/pulls)MITPHPPHP &gt;=5.4.0CI passing

Since Sep 16Pushed 6mo ago3 watchersCompare

[ Source](https://github.com/pierredup/toggler)[ Packagist](https://packagist.org/packages/pierredup/toggler)[ RSS](/packages/pierredup-toggler/feed)WikiDiscussions master Synced 1mo ago

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

Toggler
=======

[](#toggler)

[![Test Suite](https://github.com/SolidWorx/Toggler/workflows/Toggler%20Test%20Suite/badge.svg)](https://github.com/SolidWorx/Toggler/workflows/Toggler%20Test%20Suite/badge.svg)[![codecov](https://camo.githubusercontent.com/0755d445e57b1e5250923d03ebe40cbefea499ab4928ab906442c3fc65f51cfc/68747470733a2f2f636f6465636f762e696f2f67682f536f6c6964576f72782f546f67676c65722f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d34376f7057786b667656)](https://codecov.io/gh/SolidWorx/Toggler)

Toggler is a feature toggle library for PHP. It allows you to enable or disable features based on a toggle switch. This is useful in a continues deployment environment, where you can deploy not-yet-ready features which are disabled, and just enable them when the feature is complete.

Table of Contents
=================

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
    - [Composer](#composer)
- [Usage](#usage)
    - [StorageFactory](#config)
    - [Toggle a feature](#toggle-a-feature)
    - [Toggle a feature based on context](#toggle-a-feature-based-on-context)
    - [Using Symfony Expression Language](#using-symfony-expression-language)
    - [Custom storage to retrieve feature settings](#custom-storage-to-retrieve-feature-settings)
- [Twig integration](#twig-integration)
- [Symfony integration](#symfony-integration)
- [Testing](#testing)
- [Contributing](#contributing)
- [Licence](#licence)

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

[](#requirements)

Toggler requires PHP 8.1+ and Symfony 6.1+

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

[](#installation)

### Composer

[](#composer)

```
$ composer require solidworx/toggler:^2.0
```

Usage
-----

[](#usage)

### Quick Example

[](#quick-example)

```
