You are here

function variable_build_variable in Variable 7.2

Same name and namespace in other branches
  1. 6 variable.inc \variable_build_variable()
  2. 7 variable.inc \variable_build_variable()

Build single variable

Some variables may spawn into multiple ones

2 calls to variable_build_variable()
variable_build in ./variable.module
Build full variable data
variable_build_options in ./variable.inc
Build variable with options

File

./variable.inc, line 108
Variable API module. Extended API.

Code

function variable_build_variable($variable, $options = array()) {
  if (empty($variable['built'])) {
    variable_include($variable);

    // Mark as built so we don't build it again
    $variable['built'] = TRUE;
    $options = _variable_options($options);
    $variable = _variable_variable($variable, $options);

    // If the variable has a build callback, go for it
    if (isset($variable['build callback'])) {
      $variable = variable_callback($variable['build callback'], $variable, $options);
    }
  }
  return $variable;
}