/**
* Helper method to render the output in a table
*
* @param array $array Array to be shown in the table
* @param string $col1 Label for the first table column
* @param string $col2 Label for the second table column
* @param string|array $class One or more CSS classes to add to the table
*/
public function dbc_render_table($array, $col1 = null, $col2 = null, $class = null)
{
$classes = self::DBC_NAME;
if (isset($class)) {
if (is_string($class) && $class !== '') {
$classes .= ' ' . $class;
} else {
if (is_array($class) && $class !== array()) {
$classes = $classes . ' ' . implode(' ', $class);
}
}
}
$col1 = isset($col1) ? $col1 : __('Name', self::DBC_NAME);
$col2 = isset($col2) ? $col2 : __('Value', self::DBC_NAME);
uksort($array, 'strnatcasecmp');
if (defined('Debug_Bar_Pretty_Output::VERSION')) {
echo Debug_Bar_Pretty_Output::get_table($array, $col1, $col2, $classes);
// xss: ok
} else {
// An old version of the pretty output class was loaded
Debug_Bar_Pretty_Output::render_table($array, $col1, $col2, $classes);
}
}