1 |
<refentry id="{@id}"> |
2 |
<refnamediv> |
3 |
<refname>HTMLagClass</refname> |
4 |
<refpurpose>This is the base HTML Tag class.</refpurpose> |
5 |
</refnamediv> |
6 |
<refsynopsisdiv> |
7 |
<refsynopsisdivinfo> |
8 |
<author> |
9 |
by Walter A. Boring IV |
10 |
<authorblurb>{@link mailto:waboring@3gstech.com}</authorblurb> |
11 |
</author> |
12 |
<copyright>March 2004, Walter A. Boring IV</copyright> |
13 |
<releaseinfo>phpHtmlLib 2.4.x</releaseinfo> |
14 |
</refsynopsisdivinfo> |
15 |
</refsynopsisdiv> |
16 |
|
17 |
<refsect1 id="{@id description}"> |
18 |
<title>Description</title> |
19 |
<para>This class is a child of the {@tutorial XMLTagClass.cls}. It has all of the functionality for building all of the various |
20 |
HTML tags in either HTML mode or XHTML mode. Each HTML tag has specific attributes that make it unique, and this class |
21 |
provides the framework for all of those features. Each actual HTML tag is a child of this class that specifies the specific |
22 |
attributes and quirks for itself.</para> |
23 |
<para> Each W3C supported HTML tag is specified as a child of the HTMLTagClass in the phpHtmlLib tag_classes/ALLTAGS.inc file. |
24 |
You should look there to see the particulars on how each supported HTML tag is different from one another.</para> |
25 |
</refsect1> |
26 |
|
27 |
<refsect1 id="{@id constructor}"> |
28 |
<title>Creating an HTML tag object.</title> |
29 |
<para> |
30 |
<para>Since each W3C supported HTML tag is already defined as a child of the HTMLTagClass, we just |
31 |
create the specific tag object that we are interested in.</para> |
32 |
<para> Each HTML Tag that phpHtmlLib supports is a class that is defined as follows: |
33 |
{TAGNAME}tag(). So if you want an img tag the class name is |
34 |
IMGtag. Lets look at an example for an anchor tag.</para> |
35 |
<example> |
36 |
<![CDATA[ |
37 |
$a = new Atag( array('href'" => "http://phphtmllib.newsblob.com"), |
38 |
'phpHtmlLib website'); |
39 |
print $a->render();]]> |
40 |
</example> |
41 |
</para> |
42 |
|
43 |
<para>Output: |
44 |
<example><![CDATA[<a href="http://phphtmllib.newsblob.com">phpHtmlLib website</a>]]></example> |
45 |
</para> |
46 |
|
47 |
</refsect1> |
48 |
|
49 |
<refsect1 id="{@id helper}"> |
50 |
<title>Creating a HTML tag object with a helper function.</title> |
51 |
<para> |
52 |
<para>Each HTML tag also has a 'helper' function defined to help build the tag |
53 |
with parameters that are for the most common attributes/values for each specific tag. |
54 |
The function name is always in the format of |
55 |
html_{tagname}(). So an anchor tag function would be as follows.</para> |
56 |
<example> |
57 |
<![CDATA[$a = html_a("http://phphtmllib.newsblob.com", 'phpHtmlLib website'); |
58 |
print $a->render();]]> |
59 |
</example> |
60 |
</para> |
61 |
|
62 |
<para>Output: |
63 |
<example><![CDATA[<a href="http://phphtmllib.newsblob.com">phpHtmlLib website</a>]]></example> |
64 |
</para> |
65 |
</refsect1> |
66 |
|
67 |
</refentry> |