You are here

function ds_static_variables in Display Suite 6.2

Same name and namespace in other branches
  1. 6.3 ds.module \ds_static_variables()
  2. 6 ds.module \ds_static_variables()

Set or get static variables at runtime.

3 calls to ds_static_variables()
ds_regiontoblock::block_view in plugins/ds_regiontoblock.inc
plugin block view
ds_regiontoblock::execute in plugins/ds_regiontoblock.inc
execute().
ds_variable_get in ./ds.module
Module-aware version of variable_get.

File

./ds.module, line 197
Core functions for the Display Suite module.

Code

function ds_static_variables($key, $data = NULL) {
  static $variables = array();
  if (!isset($data) && isset($variables[$key])) {
    return $variables[$key];
  }
  elseif (isset($data)) {
    if (!isset($variables[$key])) {
      $variables[$key] = array();
    }
    $variables[$key][] = $data;
  }
}