jacobbuck/silverstripe-flags

This package is abandoned and no longer maintained. No replacement package was suggested.

Feature flag toggling for SilverStripe.

Installs: 22 932

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 3

Open Issues: 0

Type:silverstripe-vendormodule

2.0.1 2020-07-16 04:27 UTC

This package is not auto-updated.

Last update: 2022-08-11 14:21:22 UTC


README

Feature flag toggling for SilverStripe.

Usage

Add your flags to your website or module config:

JacobBuck\Flags\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:

    use JacobBuck\Flags\Flag;
    
    ...
    
    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 4+

Installation

The recommended way to install is through Composer:

composer require jacobbuck/silverstripe-flags