Location: PHPKode > scripts > MyTemplate > mytemplate/MyTemplate_doc.html
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Frameset//EN''http://www.w3.org/TR/REC-html40/frameset.dtd'>
<!--NewPage-->
<HTML>
<HEAD>
	<!-- Generated by PhpDoc date: 'Sat, 12 Oct 2002 22:09:56 +0400' -->
	<TITLE>Docs For Class MyTemplate</TITLE>
<LINK REL ='stylesheet' TYPE='text/css' HREF='stylesheet.css' TITLE='Style'>
</HEAD>
<BODY BGCOLOR='white'>

<!-- Start of Class Data -->
<H2>
	Class MyTemplate
</H2>
<pre>
MyTemplate
</pre>
<H3>
	<a href=MyTemplate_doc.html#block>Class Block</a>
</H3>

<p>
	<b><i>Located in File: Program_Root/MyTemplate.class.php</i></b><br>
</p>
<hr>
<!-- ========== Info from phpDoc block ========= -->
<b>Template engine.</b>
<pre>
Features:
	
	1. Nested templates:
	This engine allow include templates directly in another template file
	and place his content in any other templates.
 Not necessary to parse nested templates specialy. 
 When you call parse method for template - all nested templates loadded from this one will be parsed.
 To use nested templates include line such this:
 &lt;!-- LOAD template_handler file.name --&gt;
 Note: If you include file by relative path, keep in mind 
 that path to file calculate from dir where your script is running,
 NOT from dir where template, contains nested files, placed !
 This only loads template file and make his content available to ANY other templates.
 His content may be included as usual var - {template_handler}.
 Note: Its a good idia to use some prefix for nested template handler. 
 Its avoid from overwriting value by assignment variable with the same name.
  
	2. &quot;Automagicaly&quot; :) parsing of dinamic blocks.
	MyTemplate allow to use trees of dinamic blocks.
	No more parsing blocks 'by hand'. 
	Only set contents for blocks and get a result! 
 For more details see:	MyTemplate::assignBlockVars(), Block::assignVars();
 
 3. Global PHP variables(scalar) and constants parsed into template w/o any assignments.
 
 4. Multiple template directories.
 
 5. Other features same as in other template engines (and maybe I forget some features :) ).
</pre>
<UL>
	
	<LI><b>Package</b> - <CODE>MyTemplate</CODE></LI>
	
	<LI><b>Version</b> - <CODE>1.0 10/12/02</CODE></LI>
	
	<LI><b>Author</b> - <CODE>Dmitry Levashov	&lt;<a href="mailto:hide@address.com">hide@address.com</a>&gt; &lt;<a href="mailto:hide@address.com">hide@address.com</a>&gt;</CODE></LI>
	
	<LI><b>Copyright</b> - <CODE>lisence GPL</CODE></LI>
	
</UL>

<hr>
<!-- =========== VAR SUMMARY =========== -->
<A NAME='var_summary'><!-- --></A>
<TABLE BORDER='1' CELLPADDING='3' CELLSPACING='0' WIDTH='100%'>
	<TR BGCOLOR='#CCCCFF' CLASS='TableHeadingColor'>
		<TD>
			<FONT SIZE='+2'><B>Class Variable Summary</B></FONT>
		</TD>
	</TR>

	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#$Blocks'>$Blocks</A></B></CODE>
			<BR>
			<blockquote> array of blocks (objects) </blockquote>
			<blockquote> Default Value: <CODE>->array()<-</CODE> </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#$Dirs'>$Dirs</A></B></CODE>
			<BR>
			<blockquote> array of templates dirs </blockquote>
			<blockquote> Default Value: <CODE>->array()<-</CODE> </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#$Files'>$Files</A></B></CODE>
			<BR>
			<blockquote> array of template file names </blockquote>
			<blockquote> Default Value: <CODE>->array()<-</CODE> </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#$Templ'>$Templ</A></B></CODE>
			<BR>
			<blockquote> array of templates content </blockquote>
			<blockquote> Default Value: <CODE>->array()<-</CODE> </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#$Vals'>$Vals</A></B></CODE>
			<BR>
			<blockquote> array of values of assigned vars </blockquote>
			<blockquote> Default Value: <CODE>->array()<-</CODE> </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#$Vars'>$Vars</A></B></CODE>
			<BR>
			<blockquote> array of assigned vars names </blockquote>
			<blockquote> Default Value: <CODE>->array()<-</CODE> </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#$_repeat'>$_repeat</A></B></CODE>
			<BR>
			<blockquote> Do we need to parse nested templates 
 any time we found his entrance </blockquote>
			<blockquote> Default Value: <CODE>->false<-</CODE> </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#$_unassigned'>$_unassigned</A></B></CODE>
			<BR>
			<blockquote> string for undefined vars replacement </blockquote>
			<blockquote> Default Value: <CODE>-><-</CODE> </blockquote>
		</TD>
	</TR>
	
</TABLE>

<hr>
<!-- =========== VAR SUMMARY =========== -->
<A NAME='var_summary'><!-- --></A>
<TABLE BORDER='1' CELLPADDING='3' CELLSPACING='0' WIDTH='100%'>
	<TR BGCOLOR='#CCCCFF' CLASS='TableHeadingColor'>
		<TD>
			<FONT SIZE='+2'><B>Inherited Class Variable Summary</B></FONT>
		</TD>
	</TR>

	
</TABLE>

<hr>
<!-- =========== INHERITED METHOD SUMMARY =========== -->
<A NAME='functions_inherited'><!-- --></A>
<TABLE BORDER='1' CELLPADDING='3' CELLSPACING='0' WIDTH='100%'>
	<TR BGCOLOR='#CCCCFF' CLASS='TableHeadingColor'>
		<TD>
			<FONT SIZE='+2'><B>Inherited Method Summary</B></FONT>
		</TD>
	</TR>

	
</TABLE>

<br>
<!-- should have constructor at some point -->
<!-- =========== Method SUMMARY =========== -->
<A NAME='Method_summary'><!-- --></A>
<TABLE BORDER='1' CELLPADDING='3' CELLSPACING='0' WIDTH='100%'>
	<TR BGCOLOR='#CCCCFF' CLASS='TableHeadingColor'>
		<TD>
			<FONT SIZE='+2'><B>Method Summary</B></FONT>
		</TD>
	</TR>

	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#constructor MyTemplate'>void constructor MyTemplate ( [$dir = '.'] )</A></B></CODE>
			<BR>
			<blockquote> The class ontructor. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#assignBlockVars'>void assignBlockVars ( $path, $vars, [$level = 0] )</A></B></CODE>
			<BR>
			<blockquote> Assign variables for block. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#assignVars'>void assignVars ( $var, [$val = ''], [$append = ''false''] )</A></B></CODE>
			<BR>
			<blockquote> Variable assignment. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#cleanVar'>void cleanVar ( $var )</A></B></CODE>
			<BR>
			<blockquote> Clean variable value. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#fprint'>void fprint ( $handle )</A></B></CODE>
			<BR>
			<blockquote> print value of variable </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#parse'>void parse ( $handle, [$target = ''], [$append = ''false''] )</A></B></CODE>
			<BR>
			<blockquote> Parse template into var. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#repeatNestedTempl'>void repeatNestedTempl ( [$repeat = true] )</A></B></CODE>
			<BR>
			<blockquote> Set mode of parsing nested templates. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#setDir'>void setDir ( $dir )</A></B></CODE>
			<BR>
			<blockquote> Add dir to array of templates dirs. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#setFile'>void setFile ( $handle, [$file = ''] )</A></B></CODE>
			<BR>
			<blockquote> Add template file. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#setUnassign'>void setUnassign ( [$str = ''] )</A></B></CODE>
			<BR>
			<blockquote> Set value for all unassigned variables. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#_complite'>void _complite ( $handle )</A></B></CODE>
			<BR>
			<blockquote> Parse constants and global variables defined in template
 and replace any rest unassigned vars with $this-&gt;undef string </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#_cutBlocks'>void _cutBlocks ( $handle )</A></B></CODE>
			<BR>
			<blockquote> Scan template content for dinamic blocks. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#_error'>void _error ( $msg, [$halt = true] )</A></B></CODE>
			<BR>
			<blockquote> Print error message [and halt script] </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#_getFileName'>string _getFileName ( $file )</A></B></CODE>
			<BR>
			<blockquote> Return absolute path to file, if file exists. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#_loadFile'>void _loadFile ( $handle )</A></B></CODE>
			<BR>
			<blockquote> Load template content into $Templ </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='MyTemplate.html#_loadInclude'>void _loadInclude ( $handle )</A></B></CODE>
			<BR>
			<blockquote> Load nested templates. </blockquote>
		</TD>
	</TR>
	
</TABLE>

<hbr>
<!-- ============ VARIABLE DETAIL =========== -->

<A NAME='variable_detail'></A>
<TABLE BORDER='1' CELLPADDING='3' CELLSPACING='0' WIDTH='100%'>
	<TR BGCOLOR='#CCCCFF' CLASS='TableHeadingColor'>
		<TD>
			<FONT SIZE='+2'><B>Variable Detail</B></FONT>
		</TD>
	</TR>
</TABLE>


<A NAME='$Blocks'><!-- --></A><H3>$Blocks</H3>
<b>Data type:</b> array<br>
<!-- ========== Info from phpDoc block ========= -->
<b>array of blocks (objects)</b>
<pre>

</pre>
<UL>
	
</UL>

<HR>

<A NAME='$Dirs'><!-- --></A><H3>$Dirs</H3>
<b>Data type:</b> array<br>
<!-- ========== Info from phpDoc block ========= -->
<b>array of templates dirs</b>
<pre>

</pre>
<UL>
	
</UL>

<HR>

<A NAME='$Files'><!-- --></A><H3>$Files</H3>
<b>Data type:</b> array<br>
<!-- ========== Info from phpDoc block ========= -->
<b>array of template file names</b>
<pre>

</pre>
<UL>
	
</UL>

<HR>

<A NAME='$Templ'><!-- --></A><H3>$Templ</H3>
<b>Data type:</b> array<br>
<!-- ========== Info from phpDoc block ========= -->
<b>array of templates content</b>
<pre>

</pre>
<UL>
	
</UL>

<HR>

<A NAME='$Vals'><!-- --></A><H3>$Vals</H3>
<b>Data type:</b> array<br>
<!-- ========== Info from phpDoc block ========= -->
<b>array of values of assigned vars</b>
<pre>

</pre>
<UL>
	
</UL>

<HR>

<A NAME='$Vars'><!-- --></A><H3>$Vars</H3>
<b>Data type:</b> array<br>
<!-- ========== Info from phpDoc block ========= -->
<b>array of assigned vars names</b>
<pre>

</pre>
<UL>
	
</UL>

<HR>

<A NAME='$_repeat'><!-- --></A><H3>$_repeat</H3>
<b>Data type:</b> bool<br>
<!-- ========== Info from phpDoc block ========= -->
<b>Do we need to parse nested templates 
 any time we found his entrance</b>
<pre>

</pre>
<UL>
	
</UL>

<HR>

<A NAME='$_unassigned'><!-- --></A><H3>$_unassigned</H3>
<b>Data type:</b> string<br>
<!-- ========== Info from phpDoc block ========= -->
<b>string for undefined vars replacement</b>
<pre>

</pre>
<UL>
	
</UL>

<HR>


<hr>
<!-- ============ FUNCTION DETAIL =========== -->

<A NAME='function_detail'></A>
<TABLE BORDER='1' CELLPADDING='3' CELLSPACING='0' WIDTH='100%'>
	<TR BGCOLOR='#CCCCFF' CLASS='TableHeadingColor'>
		<TD>
			<FONT SIZE='+2'><B>Method Detail</B></FONT>
		</TD>
	</TR>
</TABLE>


<A NAME='constructor MyTemplate'><!-- --></A><H3>constructor MyTemplate</H3>
<P><B>void constructor MyTemplate ( [$dir = '.'] )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>The class ontructor.</b>
<pre>
By default use current dir as template dir
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $dir</i>: templates dirname</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='assignBlockVars'><!-- --></A><H3>assignBlockVars</H3>
<P><B>void assignBlockVars ( $path, $vars, [$level = 0] )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Assign variables for block.</b>
<pre>
Param path contain path to nested block in format &quot;PARENT.CHILD1.CHILD2&quot; or top-level block name.
 Level - level of nested blocks.
 This param tells all blocks with level &gt;= $level to create new iteration.
 So you can set variables for one block iteration several times.
 Top-level block has level = 1.
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $path</i>: path to block</CODE></DD>
	
	<DD><CODE>- <i>array $vars</i>: variables</CODE></DD>
	
	<DD><CODE>- <i>int $level</i>: level</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='assignVars'><!-- --></A><H3>assignVars</H3>
<P><B>void assignVars ( $var, [$val = ''], [$append = ''false''] )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Variable assignment.</b>
<pre>

</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>mixed $var</i>: variable name or array of variables</CODE></DD>
	
	<DD><CODE>- <i>string $val</i>: variable value</CODE></DD>
	
	<DD><CODE>- <i>bool $append</i>: append new value to var value</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='cleanVar'><!-- --></A><H3>cleanVar</H3>
<P><B>void cleanVar ( $var )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Clean variable value.</b>
<pre>

</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $var</i>: var name</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='fprint'><!-- --></A><H3>fprint</H3>
<P><B>void fprint ( $handle )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>print value of variable</b>
<pre>

</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $handle</i>: var name</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='parse'><!-- --></A><H3>parse</H3>
<P><B>void parse ( $handle, [$target = ''], [$append = ''false''] )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Parse template into var.</b>
<pre>
If target is not set, parse into variable with name of template handler.
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $handle</i>: template handler</CODE></DD>
	
	<DD><CODE>- <i>string $target</i>: variable name to parse in</CODE></DD>
	
	<DD><CODE>- <i>bool $append</i>: append parsed string to variable</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='repeatNestedTempl'><!-- --></A><H3>repeatNestedTempl</H3>
<P><B>void repeatNestedTempl ( [$repeat = true] )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Set mode of parsing nested templates.</b>
<pre>
If set to true - nested templates will be parsed 
 for each their entrances in other templates.
 By default this flag is set to false.
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>bool $repeat</i>: </CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='setDir'><!-- --></A><H3>setDir</H3>
<P><B>void setDir ( $dir )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Add dir to array of templates dirs.</b>
<pre>
dir can be directory name aor array of dirnames
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>mixed $dir</i>: templates dirname</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='setFile'><!-- --></A><H3>setFile</H3>
<P><B>void setFile ( $handle, [$file = ''] )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Add template file.</b>
<pre>
Can add one file or array of files.
 File name can be set in 3ways - by absolute path, 
 by relative path from current dir or simply by file name, 
 in this case file will be searched in all template dirs ($this-&gt;Dirs)
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>mixed $handle</i>: template handler or array(handle=>file)</CODE></DD>
	
	<DD><CODE>- <i>string $file</i>: filename</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='setUnassign'><!-- --></A><H3>setUnassign</H3>
<P><B>void setUnassign ( [$str = ''] )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Set value for all unassigned variables.</b>
<pre>
Usefull for debug.
 To see variable name use back reference,
 for example $Templ-&gt;setUnassign(&quot;! undefine \\1 !&quot;)
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $str</i>: </CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='_complite'><!-- --></A><H3>_complite</H3>
<P><B>void _complite ( $handle )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Parse constants and global variables defined in template
 and replace any rest unassigned vars with $this-&gt;undef string</b>
<pre>
Note: constants must define in template as {PHP.CONSTANT_NAME},
 global variables - as {PHP.$var_name}.
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $handle</i>: template handler</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='_cutBlocks'><!-- --></A><H3>_cutBlocks</H3>
<P><B>void _cutBlocks ( $handle )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Scan template content for dinamic blocks.</b>
<pre>
Block defines as &quot;&lt;!-- BEGIN block_name --&gt; here {block} content &lt;!-- END block_name --&gt;&quot;.
 If any one found, for each top-level block create object Block and give him his content.
 Block scan his content for nested blocks and create childs objects 
 for each his top-level block, and so on so on...
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $handle</i>: template handler</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='_error'><!-- --></A><H3>_error</H3>
<P><B>void _error ( $msg, [$halt = true] )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Print error message [and halt script]</b>
<pre>

</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $msg</i>: eroor message</CODE></DD>
	
	<DD><CODE>- <i>bool $halt</i>: halt script or not?</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='_getFileName'><!-- --></A><H3>_getFileName</H3>
<P><B>string _getFileName ( $file )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Return absolute path to file, if file exists.</b>
<pre>

</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $file</i>: filename</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='_loadFile'><!-- --></A><H3>_loadFile</H3>
<P><B>void _loadFile ( $handle )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Load template content into $Templ</b>
<pre>

</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $handle</i>: template file handler</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='_loadInclude'><!-- --></A><H3>_loadInclude</H3>
<P><B>void _loadInclude ( $handle )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Load nested templates.</b>
<pre>
Search template content for nested templates and load its.
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $handle</i>: template handler</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>


<hr>

<!-- Start of Class Data -->
<H2><a name=block>
		Class Block
	</a>
</H2>
<pre>
Block
</pre>

<p>
	<b><i>Located in File: Program_Root/MyTemplate.class.php</i></b><br>
</p>
<hr>
<!-- ========== Info from phpDoc block ========= -->
<b>Auxiliary class for MyTemplate for dinamic block manipulations.</b>
<pre>
Dont use it directly.
</pre>
<UL>
	
	<LI><b>Package</b> - <CODE>MyTemplate</CODE></LI>
	
</UL>

<hr>
<!-- =========== VAR SUMMARY =========== -->
<A NAME='var_summary'><!-- --></A>
<TABLE BORDER='1' CELLPADDING='3' CELLSPACING='0' WIDTH='100%'>
	<TR BGCOLOR='#CCCCFF' CLASS='TableHeadingColor'>
		<TD>
			<FONT SIZE='+2'><B>Class Variable Summary</B></FONT>
		</TD>
	</TR>

	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='Block.html#$Childs'>$Childs</A></B></CODE>
			<BR>
			<blockquote> Array of nested top-levels blocks </blockquote>
			<blockquote> Default Value: <CODE>->array()<-</CODE> </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='Block.html#$Content'>$Content</A></B></CODE>
			<BR>
			<blockquote> Block content. </blockquote>
			<blockquote> Default Value: <CODE>-><-</CODE> </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='Block.html#$Name'>$Name</A></B></CODE>
			<BR>
			<blockquote> Block name </blockquote>
			<blockquote> Default Value: <CODE>-><-</CODE> </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='Block.html#$Vars'>$Vars</A></B></CODE>
			<BR>
			<blockquote> Block variables array. </blockquote>
			<blockquote> Default Value: <CODE>->array()<-</CODE> </blockquote>
		</TD>
	</TR>
	
</TABLE>

<hr>
<!-- =========== VAR SUMMARY =========== -->
<A NAME='var_summary'><!-- --></A>
<TABLE BORDER='1' CELLPADDING='3' CELLSPACING='0' WIDTH='100%'>
	<TR BGCOLOR='#CCCCFF' CLASS='TableHeadingColor'>
		<TD>
			<FONT SIZE='+2'><B>Inherited Class Variable Summary</B></FONT>
		</TD>
	</TR>

	
</TABLE>

<hr>
<!-- =========== INHERITED METHOD SUMMARY =========== -->
<A NAME='functions_inherited'><!-- --></A>
<TABLE BORDER='1' CELLPADDING='3' CELLSPACING='0' WIDTH='100%'>
	<TR BGCOLOR='#CCCCFF' CLASS='TableHeadingColor'>
		<TD>
			<FONT SIZE='+2'><B>Inherited Method Summary</B></FONT>
		</TD>
	</TR>

	
</TABLE>

<br>
<!-- should have constructor at some point -->
<!-- =========== Method SUMMARY =========== -->
<A NAME='Method_summary'><!-- --></A>
<TABLE BORDER='1' CELLPADDING='3' CELLSPACING='0' WIDTH='100%'>
	<TR BGCOLOR='#CCCCFF' CLASS='TableHeadingColor'>
		<TD>
			<FONT SIZE='+2'><B>Method Summary</B></FONT>
		</TD>
	</TR>

	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='Block.html#constructor Block'>void constructor Block ( $name, &$cont )</A></B></CODE>
			<BR>
			<blockquote> Class contructor. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='Block.html#assignVars'>void assignVars ( $name, &$data, [$level = 0], [$key = '0'] )</A></B></CODE>
			<BR>
			<blockquote> Set block variables. </blockquote>
		</TD>
	</TR>
	
	<!-- =========== Summary =========== -->
	<TR BGCOLOR='white' CLASS='TableRowColor'>
		<TD>
			<CODE><B><A HREF='Block.html#parse'>string parse ( [$key = '0'] )</A></B></CODE>
			<BR>
			<blockquote> Parse content and return it. </blockquote>
		</TD>
	</TR>
	
</TABLE>

<hbr>
<!-- ============ VARIABLE DETAIL =========== -->

<A NAME='variable_detail'></A>
<TABLE BORDER='1' CELLPADDING='3' CELLSPACING='0' WIDTH='100%'>
	<TR BGCOLOR='#CCCCFF' CLASS='TableHeadingColor'>
		<TD>
			<FONT SIZE='+2'><B>Variable Detail</B></FONT>
		</TD>
	</TR>
</TABLE>


<A NAME='$Childs'><!-- --></A><H3>$Childs</H3>
<b>Data type:</b> array<br>
<!-- ========== Info from phpDoc block ========= -->
<b>Array of nested top-levels blocks</b>
<pre>

</pre>
<UL>
	
</UL>

<HR>

<A NAME='$Content'><!-- --></A><H3>$Content</H3>
<b>Data type:</b> string<br>
<!-- ========== Info from phpDoc block ========= -->
<b>Block content.</b>
<pre>

</pre>
<UL>
	
</UL>

<HR>

<A NAME='$Name'><!-- --></A><H3>$Name</H3>
<b>Data type:</b> string<br>
<!-- ========== Info from phpDoc block ========= -->
<b>Block name</b>
<pre>

</pre>
<UL>
	
</UL>

<HR>

<A NAME='$Vars'><!-- --></A><H3>$Vars</H3>
<b>Data type:</b> array<br>
<!-- ========== Info from phpDoc block ========= -->
<b>Block variables array.</b>
<pre>
Var[key][inum] = array('vars'=&gt;array(), 'vals'=&gt;array())
 key - key of parents iteration.
 inum - number of iteration in current parent iteration
 vars - array of variables names
 vals - array of variable values
</pre>
<UL>
	
</UL>

<HR>


<hr>
<!-- ============ FUNCTION DETAIL =========== -->

<A NAME='function_detail'></A>
<TABLE BORDER='1' CELLPADDING='3' CELLSPACING='0' WIDTH='100%'>
	<TR BGCOLOR='#CCCCFF' CLASS='TableHeadingColor'>
		<TD>
			<FONT SIZE='+2'><B>Method Detail</B></FONT>
		</TD>
	</TR>
</TABLE>


<A NAME='constructor Block'><!-- --></A><H3>constructor Block</H3>
<P><B>void constructor Block ( $name, &$cont )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Class contructor.</b>
<pre>
Search content for nested blocks and create childs object for each top-level block.
 &#1050;&#1086;&#1085;&#1089;&#1090;&#1088;&#1091;&#1082;&#1090;&#1086;&#1088;. &#1059;&#1089;&#1090;&#1072;&#1085;&#1072;&#1074;&#1083;&#1080;&#1074;&#1072;&#1077;&#1090; &#1080;&#1084;&#1103; &#1073;&#1083;&#1086;&#1082;&#1072; &#1080; &#1082;&#1086;&#1085;&#1090;&#1077;&#1085;&#1090;.
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $name</i>: block name</CODE></DD>
	
	<DD><CODE>- <i>string $cont</i>: block content</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='assignVars'><!-- --></A><H3>assignVars</H3>
<P><B>void assignVars ( $name, &$data, [$level = 0], [$key = '0'] )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Set block variables.</b>
<pre>
If variables addressed to this block - set its.
 Otherwise pass data to child block.
 While passed data to child, decrease level by 1 
 and add to parent key number of his iteration.
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $name</i>: block name or path to block</CODE></DD>
	
	<DD><CODE>- <i>array $data</i>: block variables</CODE></DD>
	
	<DD><CODE>- <i>int $level</i>: on wich level create new iteration</CODE></DD>
	
	<DD><CODE>- <i>string $key</i>: parent iteration key</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>

<A NAME='parse'><!-- --></A><H3>parse</H3>
<P><B>string parse ( [$key = '0'] )</B></P>
<P></P>
<!-- ========== Info from phpDoc block ========= -->
<b>Parse content and return it.</b>
<pre>
Replace childs blocks declarations to childs parsed content
</pre>
<DL>
	<DT>Function Parameters:</DT>
	
	<DD><CODE>- <i>string $key</i>: parent iteration key</CODE></DD>
	

	<DT>Function Info:</DT>
	
</DL>

<HR>


<hr>
</HTML>
Return current item: MyTemplate