Skip to content
🎌 Feature flag toggling for SilverStripe.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
code
docs/images
images
_config.php
composer.json
license
readme.md

readme.md

silverstripe-flags

Feature flag toggling for SilverStripe.

Usage

Add your flags to your website or module config:

Flag:
  flags:
    - Name: coolFeature
      Description: "Enable website to use cool feature."
      Enabled: true
    - Name: debugAnotherFeature
      Description: "For developers to debug another feature."
    - Name: experimentalThing
      Description: "Enables experimental thing."

You can then write code to be conditional based on if a flag is enabled:

    if (Flag::isEnabled('coolFeature')) {
        // Do something cool
    }
    <% if FlagEnabled("experimentalThing") %>
        <%-- Experimental thing template --%>
    <% end_if %>

Flags can be toggled in the CMS:

screenshot

screenshot

You can also see the history of changes to a flag:

screenshot

Requirements

  • Silverstripe 3+

Installation

The recommended way to install is through Composer:

composer require jacobbuck/silverstripe-flags
You can’t perform that action at this time.