You are here

function devel_print_object in Devel 5

Same name and namespace in other branches
  1. 6 devel.module \devel_print_object()
  2. 7 devel.module \devel_print_object()
4 calls to devel_print_object()
devel_load_object in ./devel.module
Menu callback; prints the loaded structure of the current node/user.
devel_render_object in ./devel.module
Menu callback; prints the renderstructure of the current node.
devel_views_object in ./devel.module
kdevel_print_object in ./devel.module
Print an object or array using either Krumo (if installed) or devel_print_object()

File

./devel.module, line 1153

Code

function devel_print_object($object) {
  if (is_array($object) || is_object($object)) {
    foreach ($object as $field => $value) {
      if (is_null($value)) {
        $printed_value = 'NULL';
      }
      else {
        if (is_array($value) || is_object($value)) {
          ob_start();
          print_r($value);
          $printed_value = ob_get_clean();
          $printed_value = '<pre>' . check_plain($printed_value) . '</pre>';
        }
        else {
          $printed_value = check_plain($value);
        }
      }
      $output .= theme('box', $field, $printed_value);
    }
  }
  else {
    $output .= theme('box', 'Value', check_plain($object));
  }
  return $output;
}