jacobbuck/silverstripe-flags

Feature flag toggling for SilverStripe.

Installs: 7 747

Dependents: 0

Suggesters: 0

Stars: 1

Watchers: 1

Forks: 2

Open Issues: 0

Type:silverstripe-module

1.3.0 2019-02-12 21:28 UTC

README

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