This project is not covered by Drupal’s security advisory policy.

This module is helpful for developers. Many times it needs to restrict code
to be functional on development site only or staging site only. This can be
achieved with this module. So once configured you can make your code to run on
any of the environment you want to restrict on - Development, Staging or Production(Live).

CONFIGURATION
-------------

* How to use this module
- Admin URL - http://yoursites.com/admin/config/environment
* select the Environment/Instance.
In code e.g. in hook_preprocess or theme_preprocess_html put the code:

function yourtheme_preprocess_html(&$variables) {
      $config = \Drupal::config('environment.settings');
      $site_env = $config->get('siteinstance');
      //set variable for use in Twig
      $variables['site_env'] = $site_env;
    }

* In twig file:

{% if site_env == 'dev' %}
      your code here for dev site only
    {% endif%}
Supporting organizations: 

Project information

  • caution Seeking new maintainer
    The current maintainers are looking for new people to take ownership.
  • Module categories: Administration Tools
  • Created by rahul.gore on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases