Source for file example-3.php
Documentation is available at example-3.php
header('Content-Type: application/xhtml+xml; charset=utf-8');
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<title>An XHTML 1.0 Strict standard template</title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
include_once 'Var_Dump.php';
echo '<h1>example3.php : factory approach</h1>';
* example3.php : Factory approach
* If you want to use a factory object, you will have to instanciate an
* object with the appropriate parameters, and then to use the "toString"
* method, as the display method is inacurate in this case.
// Initialise the HTML4 Table rendering (see Var_Dump/Renderer/HTML4_Table.php)
'display_mode' => 'HTML4_Table'
'bordercolor' => '#DDDDDD',
'captioncolor' => 'white',
'before_num_key' => '<font color="#CC5450"><b>',
'after_num_key' => '</b></font>',
'before_str_key' => '<font color="#5450CC">',
'after_str_key' => '</font>',
$linkedArray = array ('John', 'Jack', 'Bill');
'key-1' => 'The quick brown fox jumped over the lazy dog',
'key-3-2' => & $linkedArray,
echo $myVarDump->toString ($array);
* Displays an object (with recursion)
echo '<h2>Object (Recursive)</h2>';
$this->myChild = new child ($this);
$this->myName = 'c_parent';
function child (& $c_parent) {
$this->myParent = & $c_parent;
$recursiveObject = new c_parent ();
echo $myVarDump->toString ($recursiveObject);
* Displays a classic object
echo '<h2>Object (Classic)</h2>';
echo $myVarDump->toString ($object);
* Displays a variable using the display() method
echo '<h2>Var_Dump::display()</h2>';
echo '<p>Singleton method, uses the default configuration parameters for the rendering, because we are not using the previously instanciated object</p>';
Documentation generated on Mon, 11 Mar 2019 15:38:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|