Module Description
From Wikipedia

A feature toggle, (also feature switch, feature flag, feature flipper, conditional feature, etc.) is a technique in software development that attempts to provide an alternative to maintaining multiple source-code branches (known as feature branches).

http://en.wikipedia.org/wiki/Feature_toggle

This module gives non developers ability to show or hide features created & deployed by developers.

How to create a feature: In settings.php

$conf['feature_flags'] = array( 'site_help' => array( 'name' => 'Example feature to toggle help module', ), 'site_log' => array( 'name' => 'Example feature to toggle database logging module', ), ); How to enable/disable a feature: go to /admin/features/toggle and you will see a form as shown in the screenshot.

How to get the status of a feature in PHP:

module_load_include('inc', 'feature_toggle', 'includes/feature_toggle.api'); $is_help_feature_enabled = feature_toggle_get_status('site_help'); if($is_help_feature_enabled == TRUE){ //Do something } How to get the status of a feature in Javascript:

if(Drupal.settings.ft_enabled_features["site_help"]){ alert("Yes. site_help Feature is enabled"); } Hooks that get called when a feature is enabled/disabled:

/** * Implements hook_feature_toggle_<feature-name>_enable(). */ function feature_toggle_example_feature_toggle_site_help_enable() { module_enable(array("help"), TRUE); } /** * Implements hook_feature_toggle_<feature-name>_disable(). */ function feature_toggle_example_feature_toggle_site_help_disable() { module_disable(array("help"), TRUE); } For more information look at feature_toggle_example module code at http://cgit.drupalcode.org/feature_toggle/tree/modules/feature_toggle_ex...

Project Usage
245
Creation Date
Changed Date
Security Covered
Not Covered By Security Advisory
Version Available
Production
Module Summary
This module aims to provide a feature toggle technique in software development, allowing non-developers to show or hide features created and deployed by developers.
Data Name
feature_toggle

OPENAI CHATBOT

OPENAI CHATBOT

14:33:00
Generic Chatbot
Hi, I'm a Drupal module expert powered by OpenAI, answering your questions about the Drupal module ecosystem. How can I be helpful today? Please note that we will log your question.