Source for file Table.php
Documentation is available at Table.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at the following url: |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Frederic Poeydomenge <frederic.poeydomenge@free.fr> |
// +----------------------------------------------------------------------+
require_once 'Var_Dump/Renderer/Common.php';
* A concrete renderer for Var_Dump
* Returns a table-based representation of a variable in HTML
* @author Frederic Poeydomenge <frederic.poeydomenge@free.fr>
* Default configuration options.
* show_caption : bool, Show the caption or not
* before_num_key : string, Text to insert before a numerical key
* after_num_key : string, Text to insert after a numerical key
* before_str_key : string, Text to insert before a string key
* after_str_key : string, Text to insert after a string key
* before_type : string, Text to insert before a type
* after_type : string, Text to insert after a type
* before_value : string, Text to insert before a value
* after_value : string, Text to insert after a value
* start_table : string, Text to insert before the table
* end_table : string, Text to insert after the table
* start_tr : string, Text to insert before a row
* end_tr : string, Text to insert after a row
* start_tr_alt : string, Text to insert after an alternate row
* end_tr_alt : string, Text to insert after an alternate row
* start_td_key : string, Text to insert before the key cell
* end_td_key : string, Text to insert after the key cell
* start_td_type : string, Text to insert before the type cell
* end_td_type : string, Text to insert after the type cell
* start_td_value : string, Text to insert before the value cell
* end_td_value : string, Text to insert after the value cell
* start_td_colspan : string, Text to insert before a group cell
* end_td_colspan : string, Text to insert after a group cell
* start_caption : string, Text to insert before the caption
* end_caption : string, Text to insert after the caption
'start_table' => '<table>',
'end_table' => '</table>',
'start_tr_alt' => '<tr>',
'start_td_key' => '<td>',
'start_td_type' => '<td>',
'end_td_type' => '</td>',
'start_td_value' => '<td>',
'end_td_value' => '</td>',
'start_td_colspan' => '<td colspan="2">',
'end_td_colspan' => '</td>',
'start_caption' => '<caption>',
'end_caption' => '</caption>'
* @param array $options Parameters for the rendering.
* Returns the string representation of a variable
* @return string The string representation of the variable.
return $this->_toString_Single ();
return $this->_toString_Array ();
// {{{ _toString_Single()
* Returns the string representation of a single variable
* @return string The string representation of a single variable.
function _toString_Single ()
* Returns the string representation of a multiple variable
* @return string The string representation of a multiple variable.
function _toString_Array ()
for ($c = 0 ; $c < $counter ; $c++ ) {
if ($this->depth[$c] > 0 ) {
$txt .= $this->options['start_td_colspan'];
$txt .= $this->options['start_table'];
if ($this->options['show_caption']) {
$txt .= $this->options['end_table'];
if ($this->depth[$c] > 0 ) {
$tr = (end($stack) == 1 ) ? 'start_tr' : 'start_tr_alt';
$this->options['before_'. $comp. '_key'] .
$this->options['after_'. $comp. '_key'] .
$etr = (end($stack) == 1 ) ? 'end_tr' : 'end_tr_alt';
if (!empty ($this->value[$c])) {
$this->options['start_td_colspan'] .
Documentation generated on Mon, 11 Mar 2019 10:16:31 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|