Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Feature Flags

Security covered Under active development 115 sites

This module allows you to control which features are active in your Drupal site without changing your code. You can define feature flags and enable or disable them to show or hide functionality based on your needs.

What is Feature Flags?

Feature flags provide the ability to restrict features to certain environments, while still using the same code base on all servers.

Administration

The main administration page is located at admin/config/development/featureflags, and lists all the current feature flags in the system. A new feature flag can be created by loading admin/config/development/featureflags/add.

API

Create a feature flag as a config entity. The status of the flag (active/inactive) is stored in state. The config entity is used for defining flags, but not storing their state.

Example:


use Drupal\featureflags\Entity\FeatureFlag;

if (FeatureFlag::isActive('my_feature_flag')) {
  // Do something.
}
else {
 // Do something else.
}

Drupal 8–11

Ask your assistant about Feature Flags

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Aug 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
2.0.4 Stable 8–11 Aug 8, 2024
2.0.3 Stable 8–10 Aug 2, 2024