The plugin has no settings of its own. It reads every flag from the Features key in CakePHP's Configure.
The key name is hardcoded (FeatureFlags::CONFIG_KEY) and cannot currently be changed.
'Features' => [...]You have two options for organizing the feature flags.
-
Flattened:
'Features' => [ 'NewCheckout' => true, 'BetaDashboard' => false, ],
Feature::name('NewCheckout')->isEnabled();
-
Nested (any depth, referenced with dot notation):
'Features' => [ 'Reporting' => [ 'AdvancedExport' => true, 'PdfDownload' => false, ], ],
Feature::name('Reporting.AdvancedExport')->isEnabled();
Any method of populating Configure works. Common choices:
-
Dedicated file:
// config/features.php return [ 'Features' => [ 'NewCheckout' => true, ], ];
// config/bootstrap.php Configure::load('features');
-
Inline:
Add a
Featuressection directly inapp.php/app_local.php.app_local.phpoverridesapp.php, which is useful for environment-specific state. -
At runtime:
Configure::write('Features.NewCheckout', true);
Runtime writes take effect immediately but don't persist across requests.
Two working patterns:
- Load a base
features.phpplus an environment-specific file (e.g.features_production.php) that overrides only what differs. - Put overrides in
app_local.php(typically gitignored) to keep production state out of the repo.