Location: PHPKode > scripts > HTML Tag Maker > html-tag-maker/HTMLTagMakerClass.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>HTML Tag Maker Documentation</title>
	<style type="text/css">
	.term  {
     	vertical-align : top;
     	font-weight : bold;
     }
     
     .retval  {
     	font-style : italic;
     }
     
     </style>
</head>

<body>
<h1>HTML Tag Maker Class</h1>

	Class HtmlTagMaker by Karsten J. Mikkelsen (hide@address.com)<br>
	Version 1.1, August 2002<br>
	A class for formatting tags<br>

<h2>Constructor</h2>
<span class="term">HtmlTagMaker($tagType[, $tagAttributes=array()], [$hasEndTag=true])</span>
<table>
	<tr>
		<td class="term">$tagType</td>
		<td>
			A valid HTML tag name, not including the tag codes &lt; &gt;, e.g. "TABLE" or "tr".
		</td>
	</tr>
	<tr>
		<td class="term">$tagAttributes</td>
		<td>
			An associative array of attributes for this tag. 
			No syntax checking is involved, so the attributes must be valid in order to work and will be ignored by browsers otherwise.
			The parameter is optional. The tag will have no attributes if $tagAttributes is not supplied.<br>
			To insert one or more keywords rather than key/value pairs (e.g. selected in an option tag), include an empty string for index
			<br>
			E.g. array("ID" => "myTagID", "Name" => "myTagName", "" => "keyword_1 keyword_2").
		</td>
	</tr>
	<tr>
		<td class="term">$hasEndTag</td>
		<td>
			An optional boolean value to indicate whether there should be a closing tag.
			The default is true, so it is only necessary to pass $hasEndTag when false, e.g. if no closing tag should be used for &lt;p&gt;.
		</td>
	</tr>
</table>

<h2>Methods</h2>
<span class="term">setAttributes(<span class="retval">array</span> $tagAttributes)</span>
<p>Change or add tag attributes, see the constructor.</p>

<span class="term">$tagAttributes</span> is an associative array such as in the HtmlTagMaker constructor.
</p>

<span class="term">setSingleQuotes()</span>
<p>Use single quotes for attributes rather than double quotes (the default).</p>

<span class="term">setDoubleQuotes()</span>
<p>Reverse a previous call to setSingleQuotes().</p>

<span class="retval">String</span> <span class="term">getStartTag()</span>
<p>Return the opening tag with all attributes</p>

<span class="retval">String</span> <span class="term">getEndTag()</span>
<p>Return the closing tag</p>

<span class="retval">String</span> <span class="term">getTag($contents)</span>
<p>Return $contents enclosed within tags</p>

</body>
</html>
Return current item: HTML Tag Maker