Debug_Bar_Pretty_Output::render_table PHP Метод

render_table() публичный статический Метод

Render the table output.
Устаревший: since v1.3 in favour of get_table().
public static render_table ( array $array, string $col1, string $col2, string | array $class = null, string $deprecated = null ) : void
$array array Array to be shown in the table.
$col1 string Label for the first table column.
$col2 string Label for the second table column.
$class string | array One or more CSS classes to add to the table.
$deprecated string ==Deprecated argument.
Результат void
        public static function render_table($array, $col1, $col2, $class = null, $deprecated = null)
        {
            _deprecated_function(__CLASS__ . '::' . __METHOD__, __CLASS__ . ' 1.3', __CLASS__ . '::get_table() ' . esc_html__('or even better: upgrade your Debug Bar plugins to their current version', 'db-pretty-output'));
            echo self::get_table($array, $col1, $col2, $class);
            // WPCS: xss ok.
        }

Usage Example

 /**
  * 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);
     }
 }
All Usage Examples Of Debug_Bar_Pretty_Output::render_table