#native_company# #native_desc#
#native_cta#

PHP Layout Class Page 5

By Robbin Zhang
on July 30, 2000

template1.inc is used for creating the banner part, menu,
and left side column on the page. I keep it in one file
and include it in most of the pages at the site. I will
go over the file later.
line 3: insert($c2,generic(“hr”,array(“noshade”=>”undef”,”size”=>”1″)));
There is no <HR> constructor in the class.layout(to make it small)
But it does provide a generic way to construct HTML tags. function
‘generic’ takes two arguments, arg 1 is the tag name, arg 2 is
the attributes array. ‘$c2’ is a cell from ‘template1.inc’, The
result of line 3 would be:
<HR NOSHADE SIZE=”1″>
Since we are going to use it a lot in the page. I would define
a local function for it…

<?php

function aruler() {

    eval(
"insert($c2,generic("hr",array("noshade"=>"undef","size"=>"1))); " );

}

?>



So next time, I can use aruler() to create the <HR> tag.
line 4: insert($c2,text("UNDER CONSTRUCTION !!",array("color"=>"red")));
line 5: aruler();
line 6: insert($c2,text("<B>Launch www.vhconsultants.com (05/24/99)</B>"));
Sometimes, it is much easier to insert tags directly like ‘<B>’ used here
(line 6) to avoid another line/layer of ‘insert’.
line 7: insert($c2,text("<P>We are a group of ...."));
line 8: insert($c2,$f2 = container("font",array("face" =>
		"verdana,arial,helvetica","size" => "2")));
line 9: insert($f2,alist("UL",array("Large web sites architect/design",
					 "Web application programming")));
Here we introduce another generic constructor ‘container’ which differs
from ‘generic’ in a way of of providing a pair of HTML tags. Here we use
it to control the font of the list. the result of line 8 and line 9 would
be:
	<FONT FACE="verdana,arial,helvetica",SIZE="2">
		<UL>
		<LI>Large web sites architect/design
		<LI>Web application programming
		</UL>
	</FONT>
Keep going.

1
|
2
|
3
|
4
|
5
|
6
|
7