You are here

function variable_format_value in Variable 7

Same name and namespace in other branches
  1. 7.2 variable.module \variable_format_value()

Format printable value

Parameters

$variable:

Related topics

6 calls to variable_format_value()
variable_admin_group_list in variable_admin/variable_admin.inc
Build list of variables for group
variable_example_page_list in variable_example/variable_example.module
Variable example realm page.
variable_format_multiple in ./variable.variable.inc
Format multiple variable.
variable_form_element_unknown in ./variable.form.inc
Build form element for unknown variable.
variable_tokens in ./variable.tokens.inc
Implements hook_tokens().

... See full list

File

./variable.module, line 107
Variable API module

Code

function variable_format_value($variable, $options = array()) {
  $variable = variable_build($variable, $options);
  $variable['value'] = variable_get_value($variable, $options);
  if (isset($variable['value'])) {
    return !empty($variable['format callback']) ? variable_callback($variable['format callback'], $variable, $options) : variable_format_unknown($variable, $options);
  }
  else {
    return isset($variable['empty']) ? $variable['empty'] : t('Empty');
  }
}