You are here

function _environment_options in Environment 8

Provides environment form options.

Parameters

string $workflow: Optional; specify the workflow for specific options. Defaults to states that are not part of an explicit workflow.

string $prefix: Optional; prefix the environment label with the specified string. Defaults to no prefix.

bool $reset: Optional; reset the static cache.

Return value

array Array of form options in the style of environment => label

1 call to _environment_options()
EnvironmentAdminSettings::buildForm in src/Form/EnvironmentAdminSettings.php
Form constructor.

File

./environment.module, line 146
Module for handling changes in server environments

Code

function _environment_options($prefix = '', $reset = FALSE) {
  static $options;
  if (empty($options) || $reset) {
    $environments = environment_load();
    foreach ($environments as $name => $environment) {
      $options[$name] = $prefix . $environment
        ->get('label');
    }
  }
  return $options;
}