1 |
jonen |
1.1 |
<?xml version="1.0" encoding="iso-8859-1"?>
|
2 |
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3 |
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
4 |
|
|
<head>
|
5 |
|
|
<!-- template designed by Marco Von Ballmoos -->
|
6 |
|
|
<title>HTMLagClass</title>
|
7 |
|
|
<link rel="stylesheet" href="../media/stylesheet.css" />
|
8 |
|
|
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
|
9 |
|
|
</head>
|
10 |
|
|
<body>
|
11 |
|
|
<div class="page-body">
|
12 |
|
|
<table class="tutorial-nav-box">
|
13 |
|
|
<tr>
|
14 |
|
|
<td style="width: 30%">
|
15 |
|
|
<a href="../phpHtmlLib/tutorial_XMLTagClass.cls.html" class="nav-button">Previous</a>
|
16 |
|
|
</td>
|
17 |
|
|
<td style="text-align: center">
|
18 |
|
|
<a href="../phpHtmlLib/tutorial_XMLTagClass.cls.html" class="nav-button">Up</a>
|
19 |
|
|
</td>
|
20 |
|
|
<td style="text-align: right; width: 30%">
|
21 |
|
|
<a href="../phpHtmlLib/tutorial_phpHtmlLib.pkg.html" class="nav-button">Next</a>
|
22 |
|
|
</td>
|
23 |
|
|
</tr>
|
24 |
|
|
<tr>
|
25 |
|
|
<td style="width: 30%">
|
26 |
|
|
<span class="detail">XMLTagClass</span>
|
27 |
|
|
</td>
|
28 |
|
|
<td style="text-align: center">
|
29 |
|
|
<span class="detail">XMLTagClass</span>
|
30 |
|
|
</td>
|
31 |
|
|
<td style="text-align: right; width: 30%">
|
32 |
|
|
<span class="detail">phpHtmlLib Guide</span>
|
33 |
|
|
</td>
|
34 |
|
|
</tr>
|
35 |
|
|
</table>
|
36 |
|
|
|
37 |
|
|
<div><a name=""></a><div class="ref-title-box"><h1 class="ref-title">HTMLagClass</h1> |
38 |
|
|
<h2 class="ref-purpose">This is the base HTML Tag class.</h2></div> |
39 |
|
|
<div class="ref-synopsis"><span class="author">by Walter A. Boring IV |
40 |
|
|
<div class="author-blurb"><a href="mailto:waboring@3gstech.com">mailto:waboring@3gstech.com</a></div></span> |
41 |
|
|
<div class="notes">March 2004, Walter A. Boring IV</div> |
42 |
|
|
<div class="release-info">(phpHtmlLib 2.4.x)</div></div> |
43 |
|
|
|
44 |
|
|
<span><a name="description"></a><h2 class="title">Description</h2><p>This class is a child of the <a href="../phpHtmlLib/tutorial_XMLTagClass.cls.html">XMLTagClass</a>. It has all of the functionality for building all of the various |
45 |
|
|
HTML tags in either HTML mode or XHTML mode. Each HTML tag has specific attributes that make it unique, and this class |
46 |
|
|
provides the framework for all of those features. Each actual HTML tag is a child of this class that specifies the specific |
47 |
|
|
attributes and quirks for itself.</p> |
48 |
|
|
<p>Each W3C supported HTML tag is specified as a child of the HTMLTagClass in the phpHtmlLib tag_classes/ALLTAGS.inc file. |
49 |
|
|
You should look there to see the particulars on how each supported HTML tag is different from one another.</p></span> |
50 |
|
|
|
51 |
|
|
<span><a name="constructor"></a><h2 class="title">Creating an HTML tag object.</h2><p><p>Since each W3C supported HTML tag is already defined as a child of the HTMLTagClass, we just |
52 |
|
|
create the specific tag object that we are interested in.</p> |
53 |
|
|
<p>Each HTML Tag that phpHtmlLib supports is a class that is defined as follows: |
54 |
|
|
{TAGNAME}tag(). So if you want an img tag the class name is |
55 |
|
|
IMGtag. Lets look at an example for an anchor tag.</p> |
56 |
|
|
<pre class="example"><pre> |
57 |
|
|
$a = new Atag( array('href'" => "http://phphtmllib.newsblob.com"), |
58 |
|
|
'phpHtmlLib website'); |
59 |
|
|
print $a->render();</pre></pre></p> |
60 |
|
|
|
61 |
|
|
<p>Output: |
62 |
|
|
<pre class="example"><pre><a href="http://phphtmllib.newsblob.com">phpHtmlLib website</a></pre></pre></p></span> |
63 |
|
|
|
64 |
|
|
<span><a name="helper"></a><h2 class="title">Creating a HTML tag object with a helper function.</h2><p><p>Each HTML tag also has a 'helper' function defined to help build the tag |
65 |
|
|
with parameters that are for the most common attributes/values for each specific tag. |
66 |
|
|
The function name is always in the format of |
67 |
|
|
html_{tagname}(). So an anchor tag function would be as follows.</p> |
68 |
|
|
<pre class="example"><pre>$a = html_a("http://phphtmllib.newsblob.com", 'phpHtmlLib website'); |
69 |
|
|
print $a->render();</pre></pre></p> |
70 |
|
|
|
71 |
|
|
<p>Output: |
72 |
|
|
<pre class="example"><pre><a href="http://phphtmllib.newsblob.com">phpHtmlLib website</a></pre></pre></p></span></div>
|
73 |
|
|
|
74 |
|
|
<table class="tutorial-nav-box">
|
75 |
|
|
<tr>
|
76 |
|
|
<td style="width: 30%">
|
77 |
|
|
<a href="../phpHtmlLib/tutorial_XMLTagClass.cls.html" class="nav-button">Previous</a>
|
78 |
|
|
</td>
|
79 |
|
|
<td style="text-align: center">
|
80 |
|
|
<a href="../phpHtmlLib/tutorial_XMLTagClass.cls.html" class="nav-button">Up</a>
|
81 |
|
|
</td>
|
82 |
|
|
<td style="text-align: right; width: 30%">
|
83 |
|
|
<a href="../phpHtmlLib/tutorial_phpHtmlLib.pkg.html" class="nav-button">Next</a>
|
84 |
|
|
</td>
|
85 |
|
|
</tr>
|
86 |
|
|
<tr>
|
87 |
|
|
<td style="width: 30%">
|
88 |
|
|
<span class="detail">XMLTagClass</span>
|
89 |
|
|
</td>
|
90 |
|
|
<td style="text-align: center">
|
91 |
|
|
<span class="detail">XMLTagClass</span>
|
92 |
|
|
</td>
|
93 |
|
|
<td style="text-align: right; width: 30%">
|
94 |
|
|
<span class="detail">phpHtmlLib Guide</span>
|
95 |
|
|
</td>
|
96 |
|
|
</tr>
|
97 |
|
|
</table>
|
98 |
|
|
|
99 |
|
|
<p class="notes" id="credit">
|
100 |
|
|
Documentation generated on Thu, 1 Apr 2004 09:37:05 -0800 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC2</a>
|
101 |
|
|
</p>
|
102 |
|
|
</div></body>
|
103 |
|
|
</html>
|