NOTE: In this manpage, OBJECT sometimes is not the exact meaning of object. it refers to the name of the object.
1. ValueHunt Inc. is not responsible for the consequences of use of this software, no matter how awful, even if they arise from flaws in it.
2. The origin of this software must not be misrepresented, either by explicit claim or by omission. Since few users ever read sources, credits must appear in the documentation. and also the URL http://www.vhconsultants.com/
3. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. Since few users ever read sources, credits must appear in the documentation.
4. This notice may not be removed or altered.
include("class.layout");
Or, if you may configure a PHP3 module in Apache's httpd.conf
php3_include_path /path/to/the/class php3_auto_prepend_file class.layout php3_magic_quotes_gpc on php3_track_vars on
A simple example
<?php
setdefault("window",array("bgcolor"=>"white")); setdefault("table",array("cellpadding"=>"0")); setdefault("text",array("size"=>"2")); newhtml(&$w);
insert($w, wheader("A Test Page")) insert($w,$t = table(array("cols"=>"2","width"=>"650"))); insert($t,$c = cell(array("colspan"=>"2"))); insert($c,text("TEST ONLY"));
printhtml($w);
?>
setdefault("window",array("bgcolor"=>"white")); setdefault("table",array("cellpadding"=>"0"));
$w
with optional attributes ($a, array).
This function is <B>required</B>.
newhtml(&$w,array("bgcolor"=>"#FFFFFF", "onload"=>"some javascript here"));
$p
is the
parent object. $c
is the child object. This function is the
<B>main construction function</B> in this library.
insert($w, $t = table(array("width"=>"400","cols"=>"2"))); insert($t, $c = cell(array("colspan"=>"2","bgcolor"=>"#FFFFFF"))); insert($c, text("A TEXT CELL",array("color"=>"blue")));
printhtml($w);
$a
is an optional array of attributes for the
table and will overwrite any default value declared by
setdefault()
function.
setdefault("table",array("cellpadding"=>"0")); insert($w, $t = table(array("cellpadding"=>"3","cols"=>"3")));
This function returns the reference to the object. Table can be nested in any legal containers like cell etc. There is no <TR> constructor function in this library. the ``cols''=>``3'' attribute for table will set columns to 3 for the table.
insert($t, $c = cell()); insert($c, $t2 = table(array("width"=>"100%")));
$a
is an array of attributes. This function
returns the reference to the cell object.
insert($t, $c = cell(array("colspan"=>"2","bgcolor"=>"#FFFFFF")));
$s
is the source (location) of the image
file. $a
is an array of attributes.
insert($c, image("/title.gif",array("width"=>"10")));
$h
is the href, $s
is the text
or image object. $a
is the optional array of attributes.
insert($c,anchor("http://some.com","Click Here")); insert($c,anchor("http://some.com",image("/some.gif", array("width"=>"10"))));
$t
as the text and an optional array of
attributes.
insert($c,text("TEST",array("color"=>"red")));
$t
is the tag name, $a
is
an optional array of attributes.
to insert a horizontal ruler.
insert($c, generic("hr",array("noshade"=>"undef","size"=>"1")));
insert a break
insert($c, generic("br"));
$t
is the tag name, $a
is an optional array of attributes.
insert($w, $con = container("div",array("align"=>"center")));
insert($c, block('<B>Text here</B>'));
$a
is an optional array.
insert($c, span("text goes here",array("class"=>"BIGBLUE")));
insert($c, $f = form(array("method"=>"post","action"=>"/cgi/c.pl")));
$t
is a tag name, like ``UL'',``OL'' etc.
$c
is an array of texts or objects. $a
is the
attribute array for the list.
insert($c, $l = alist("ul",array("item1","item2")));
insert($w, comment("start the page"));
insert($h, script(" javascription goes here define lots of function but do NOT use double quotes in here ",array("language"=>"JavaScript")));
insert($w, $h = wheader("This is the title")); insert($h, script("scription goes here", array("language"=>"JavaScript")));
$l
is int from 1 to 5. $c
is the text.
insert($w, heading(1,"HEAD 1"));
insert($c, button(array("name"=>"Aname","value"=>"a button")));
insert($c, checkbox(array("name"=>"somevalue"),"A check box", "checkecd"));
$s
is the source for the image.