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>XMLTagClass</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_Container.cls.html" class="nav-button">Previous</a>
|
16 |
|
|
</td>
|
17 |
|
|
<td style="text-align: center">
|
18 |
|
|
<a href="../phpHtmlLib/tutorial_Container.cls.html" class="nav-button">Up</a>
|
19 |
|
|
</td>
|
20 |
|
|
<td style="text-align: right; width: 30%">
|
21 |
|
|
<a href="../phpHtmlLib/tutorial_HTMLTagClass.cls.html" class="nav-button">Next</a>
|
22 |
|
|
</td>
|
23 |
|
|
</tr>
|
24 |
|
|
<tr>
|
25 |
|
|
<td style="width: 30%">
|
26 |
|
|
<span class="detail">Container</span>
|
27 |
|
|
</td>
|
28 |
|
|
<td style="text-align: center">
|
29 |
|
|
<span class="detail">Container</span>
|
30 |
|
|
</td>
|
31 |
|
|
<td style="text-align: right; width: 30%">
|
32 |
|
|
<span class="detail">HTMLagClass</span>
|
33 |
|
|
</td>
|
34 |
|
|
</tr>
|
35 |
|
|
</table>
|
36 |
|
|
|
37 |
|
|
<div><a name=""></a><div class="ref-title-box"><h1 class="ref-title">XMLTagClass</h1> |
38 |
|
|
<h2 class="ref-purpose">This is the base 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 |
|
|
<span><a name="description"></a><h2 class="title">Description</h2><p>This class is the main tag class for all XML tags that phpHtmlLib supports.</p> |
44 |
|
|
<p>Each XML tag is broken down into it's name, attributes, content and an optional |
45 |
|
|
closing tag. This is also true for HTML tags.</p></span> |
46 |
|
|
|
47 |
|
|
<span><a name="constructor"></a><h2 class="title">Creating an XML tag object.</h2><p><p>The constructor of the XML tag object has 3 main parameters. |
48 |
|
|
The first parameter is the name of the tag to create. The second parameter is an array |
49 |
|
|
of key value pairs that make up the attributes and values for the tag. The third parameters is |
50 |
|
|
an infinite list of parameters that will make up the content portion of the tag.</p> |
51 |
|
|
<pre class="example"><pre>$test = new XMLTagClass('foo', array('test' => 1), 'some content'); |
52 |
|
|
print $test->render();</pre></pre></p> |
53 |
|
|
|
54 |
|
|
<p>Output: |
55 |
|
|
<pre class="example"><pre><foo test="1">some content</foo></pre></pre></p></span> |
56 |
|
|
|
57 |
|
|
<span><a name="helper"></a><h2 class="title">Creating an XML tag object with a function.</h2><p><p>The alternative way to create the same xml tag can be accomplised with a call |
58 |
|
|
to xml_tag().</p> |
59 |
|
|
<pre class="example"><pre>$test = xml_tag('foo', array('test' => 1), 'some content'); |
60 |
|
|
print $test->render();</pre></pre></p> |
61 |
|
|
|
62 |
|
|
<p>Output: |
63 |
|
|
<pre class="example"><pre><foo test="1">some content</foo></pre></pre></p></span> |
64 |
|
|
|
65 |
|
|
<span><a name="closetag"></a><h2 class="title">Closing tag</h2><p><p>The XMLTagClass automatically determines if the closing tag is needed. If there is content in the tag, |
66 |
|
|
then a closing tag is built, otherwise it closes the tag in the open tag. |
67 |
|
|
|
68 |
|
|
NOTE: you can force a close tag to be required by defining a child of the XMLTagClass and setting |
69 |
|
|
the flag the forces the close tag.</p> |
70 |
|
|
<pre class="example"><pre>$test = xml_tag('foo', array('test' => 1)); |
71 |
|
|
print $test->render();</pre></pre></p> |
72 |
|
|
|
73 |
|
|
<p>Output: |
74 |
|
|
<pre class="example"><pre><foo test="1" /></pre></pre></p></span></div>
|
75 |
|
|
|
76 |
|
|
<table class="tutorial-nav-box">
|
77 |
|
|
<tr>
|
78 |
|
|
<td style="width: 30%">
|
79 |
|
|
<a href="../phpHtmlLib/tutorial_Container.cls.html" class="nav-button">Previous</a>
|
80 |
|
|
</td>
|
81 |
|
|
<td style="text-align: center">
|
82 |
|
|
<a href="../phpHtmlLib/tutorial_Container.cls.html" class="nav-button">Up</a>
|
83 |
|
|
</td>
|
84 |
|
|
<td style="text-align: right; width: 30%">
|
85 |
|
|
<a href="../phpHtmlLib/tutorial_HTMLTagClass.cls.html" class="nav-button">Next</a>
|
86 |
|
|
</td>
|
87 |
|
|
</tr>
|
88 |
|
|
<tr>
|
89 |
|
|
<td style="width: 30%">
|
90 |
|
|
<span class="detail">Container</span>
|
91 |
|
|
</td>
|
92 |
|
|
<td style="text-align: center">
|
93 |
|
|
<span class="detail">Container</span>
|
94 |
|
|
</td>
|
95 |
|
|
<td style="text-align: right; width: 30%">
|
96 |
|
|
<span class="detail">HTMLagClass</span>
|
97 |
|
|
</td>
|
98 |
|
|
</tr>
|
99 |
|
|
</table>
|
100 |
|
|
|
101 |
|
|
<p class="notes" id="credit">
|
102 |
|
|
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>
|
103 |
|
|
</p>
|
104 |
|
|
</div></body>
|
105 |
|
|
</html>
|