jacobbuck / silverstripe-flags
Feature flag toggling for SilverStripe.
Installs: 23 818
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 3
Open Issues: 0
Type:silverstripe-vendormodule
Requires
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:
You can also see the history of changes to a flag:
Requirements
- Silverstripe 4+
Installation
The recommended way to install is through Composer:
composer require jacobbuck/silverstripe-flags