Location: PHPKode > projects > TinyButStrong > tinybutstrong/tbs_us_manual.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>TBS Manual</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.pagebreak {
	page-break-before:always;
}
.tbsname {
	font-size: 12px;
	font-weight: bolder;
	color: #4D3A81;
}
.norm {
	margin-left: 30px;
	padding: 5px;
	border: 1px solid #999999;
	margin-top: 12px;
	margin-bottom: 12px;
}
.decal {
	margin-left: 20px;
	padding: 2px;
	margin-top: 3px;
}
.title-1 {
	font-size: 16px;
}
.title-1b {
	text-decoration: underline;
}
.title-1c {
	font-weight: bold;
}
.title-2 {
	font-size: 16px;
	text-decoration: underline;
}
.title-3 {
	font-size: 16px;
	text-decoration: underline;
	background-color: #6699CC;
	margin-top: 20px;
	margin-bottom: 20px;
}
.txt-small {
	font-size: 10px;
}
.txt-code {
	font-family: "Courier New", Courier, mono;
	font-size: 12px;
}
.txt-tiny {
	font-size: 9px;
}
.asciiart {
	font-family: "Courier New", Courier, mono;
	font-size: 8px;
	font-weight: bold;
	color: #0066CC;
}
table {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
body {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
.opt-name {
	color: #990000;
}
a.opt-name {
	color: #990000;
	text-decoration:none;
}
a.opt-name:hover {
	color: #990000;
	text-decoration:underline;
}
.opt-value {
	color: #000099;
}
.opt-html {
	color: #006600;
}
.opt-type {
	font-style: italic;
	color: #0033CC;
}
.border-0 {
	border: 1px solid #999999;
}
.border-1 {
	border: 1px solid #FF3399;
}
.border-2 {
	border: 1px solid #336699;
}
.border-3 {
	border: 1.5px solid #CC6600;
}
.border-sep {
	border-bottom-width: 1px;
	border-bottom-style: solid;
	border-bottom-color: #999999;
}
.versioning {
	background-color: #EAEAEA;
}
.blockzone {
	border: 1px dotted #666666;
	padding: 2px;
	margin: 2px;
}
.blocksep {
	border-left-width: 1px;
	border-left-style: dotted;
	border-left-color: #666666;
}
.contextual {
	padding: 1px;
	border: 1px dotted #6699CC;
}
.note {
	background-color: #D9FFD9;
	border: thin solid #00EC9F;
	padding: 2px;
	margin-top: 3px;
	margin-left: 20px;
}
.todo {
	background-color: #FF6633;
}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<strong><span class="title-1"></span></strong>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="33%" align="left" valign="top"><table width="180" border="0" cellspacing="0" cellpadding="0">
        <tr class="txt-tiny">
          <td width="50">Site:</td>
          <td><a href="http://www.tinybutstrong.com" target="_top">www.tinybutstrong.com</a></td>
        </tr>
        <tr class="txt-tiny">
          <td>Authors:</td>
          <td><a href="http://www.tinybutstrong.com/onlyyou.html">skrol29</a>, Pirjo</td>
        </tr>
        <tr class="txt-tiny">
          <td>Date:</td>
          <td>2010-04-08</td>
        </tr>
      </table></td>
    <td width="34%" align="center"><span class="asciiart">*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*</span><br>
      <span class="title-1 title-1c">TinyButStrong</span><br>
      <span class="txt-tiny">version 3.5</span><br>
      <span class="asciiart">*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*.^.*</span></td>
    <td width="33%" align="right" valign="top" class="txt-small">&nbsp;</td>
  </tr>
  <tr>
    <td width="33%" align="left" valign="top">&nbsp;</td>
    <td><div align="center">Template Engine for Pro and Beginners<br>
        for PHP <span class="txt-tiny">4 and 5</span><br>
      </div></td>
    <td align="right" valign="top" class="txt-small">&nbsp;</td>
  </tr>
</table>
<br>
<div class="title-1c">Table of Contents:</div>
<div class="norm">
  <table border="0" cellspacing="0">
    <tr class="title-1c">
      <td width="300"> Subject</td>
      <td>Description</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><a href="#introduction" class="title-1c">&#8226; Introduction</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#principles">Basic principles</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#installation">Installation</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#examples">Mini examples</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><a href="#php_side" class="title-1c">&#8226; PHP side</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&#8226; To begin</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#php_loadtemplate"><span class="txt-small">method</span> LoadTemplate()</a></td>
      <td>load the contents of a template from a file</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#php_mergeblock"><span class="txt-small">method</span> MergeBlock()</a></td>
      <td>merge a part of the template with a data source</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#php_show"><span class="txt-small">method</span> Show()</a></td>
      <td>automatic processing and display of the result</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&#8226; Advanced</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#php_getblocksource"><span class="txt-small">method</span> GetBlockSource()</a></td>
      <td>returns the source of the definition of a block</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#php_mergefield"><span class="txt-small">method</span> MergeField()</a></td>
      <td>merge a specific field with a value</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#php_plugin"><span class="txt-small">method</span> PlugIn()</a></td>
      <td>execute a plug-in's action </td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#php_assigned"><span class="txt-small">property</span> Assigned</a></td>
      <td>prepares  information for a subsequent merging</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#php_noerr"><span class="txt-small">property</span> NoErr</a></td>
      <td>avoid error messages</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#php_render"><span class="txt-small">property</span> Render</a></td>
      <td> to alter the merge ending option</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#php_source"><span class="txt-small">property</span> Source</a></td>
      <td>returns the current contents of the result</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#php_tplvars"><span class="txt-small">property</span> TplVars </a></td>
      <td>returns template variables </td>
    </tr>
    <tr id="v202_oop_plan">
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#php_oop">Object Oriented Programming (OOP) </a></td>
      <td>to make TBS OOP friendly </td>
    </tr>
    <tr>
      <td><a href="#html_side" class="title-1c">&#8226; Template side</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&#8226; TBS fields</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href="#html_field">Definition and syntax</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href="#html_field_prm">Parameters</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href="#html_field_prm_order">Order of processing parameters</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href="#html_field_auto">Automatic fields</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href="#html_field_special">Special Automatic fields</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&#8226; TBS blocks</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#html_block">Definition and syntaxes </a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href="#html_block_prm">Parameters</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href="#html_block_section">Sections of block</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href="#html_block_auto">Automatic blocks </a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href="#html_block_serial">Serial display (in columns) </a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href="#html_block_subblock">Subblocks</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href="#html_block_subauto">Automatic subblocks</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href="#html_block_dynsb">Subblocks with dynamic queries</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp; &#8226; Miscellaneous</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#html_subtemplate">Subtemplates</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#html_conditional"> Conditional display overview</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><a href="#plugins" class="title-1c">&#8226; Coding plug-ins </a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#plugins_db">Database Plug-ins</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><a href="#plugins_tbs">&nbsp;&nbsp;&nbsp;&nbsp;Other plug-ins</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><a href="#summaries" class="title-1c">&#8226; Summary</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#appendix_field">TBS Field's parameters</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#appendix_block">TBS Block's parameters</a></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#appendix_specialname">Names of Special Fields and Blocks</a></td>
      <td>&nbsp;</td>
    </tr>
  </table>
</div>
<br>
<div id="introduction" class="title-2 pagebreak">Introduction:</div>
<br>
<span class="title-1c">TinyButStrong</span> (TBS) is a PHP class useful to develop an application in a clean way, separating PHP scripts and XML/HTML/Text files. With TBS, the files  are generated dynamically by merging a template with data. It is called a Template Engine.<br>
<br>
The name TBS comes from the fact that this tool contains only 8 functions and yet, it is very powerful. It allows you to merge templates with your PHP variables or your MySQL, PostgreSQL, or SQLite.<br>
<br>
TBS has been engineered so that you can develop your templates with ease using any visual  editors (like Dreamweaver or FrontPage). But if you are used to designing your templates with a text editor, it is nice as well. TBS also enables you to create JavaScript dynamically.<br>
<br>
As the name of it tells, TBS is easy to use, strong and fast. It is completely <font color="#009900">&deg;~&deg;&nbsp;freeware&nbsp;&deg;~&deg;</font>.<br>
<br>
<div class="title-2"><a name="principles" id="principles"></a>Basic principles:</div>
<br>
On the HTML side (or other file type):<br>
You design a page which does not necessarily contain any PHP scripts, nor any programming. In this page you place TBS tags in the places where you want to display the dynamic data. This page is called a 'template'.<br>
There are two types of tags: the <a href="#html_field">'fields'</a> which are used to display dynamic data items, and the <a href="#html_block">'blocks'</a> which are used to define an area, mostly in order to display records from a data source.<br>
<br>
On the PHP side:<br>
You use an object TBS variable to manage the merge of your template with the data. At the end, TBS shows the result of the merge.<br>
<br>
<div class="title-2"><a name="installation"></a>Installation:</div>
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr align="left" valign="top">
    <td width="25">1.</td>
    <td>Copy the file <span class="opt-html">tbs_class.php</span> in a directory of your Web site.</td>
  </tr>
  <tr align="left" valign="top">
    <td>2.</td>
    <td>At the beginning of your PHP program, add the lines:<br>
      <span class="txt-code">&nbsp;&nbsp;include_once(<span class="opt-value">'tbs_class.php'</span>);</span><br>
      <span class="txt-code"><span class="opt-name">&nbsp;&nbsp;$TBS</span> =&amp; <strong>new</strong> clsTinyButStrong ;</span> <br>
      <span class="txt-small">Remark: if the TBS file tbs_class.php is in a different directory than your application, then you have to precise the directory in front of the TBS file name.</span></td>
  </tr>
</table>
<br>
<span class="title-1b">Explanations and technical details:</span><br>
TinyButStrong is a library written in PHP, it's a component to be referenced in your own PHP programs. In technical terms, TinyButStrong is a PHP 'class' ; the name of this class is clsTinyButStrong.<br>
The variable $TBS that you add at the beginning of your PHP program enables you to execute the merge of your template from your PHP application. In technical terms, the variable $TBS is an 'instance' of the clsTinyButStrong class.<br>
<br>
<div class="title-2"><a name="examples" id="examples"></a>Mini examples:</div>
<br>
Example 1: <br>
<table width="100%" border="0" cellpadding="2" cellspacing="4">
  <tr class="title-1c">
    <td width="33%"> Html Template</td>
    <td>Php Program</td>
    <td width="33%">Result</td>
  </tr>
  <tr class="norm">
    <td valign="top"><span class="opt-html">&lt;html&gt;<br>
      &nbsp;&lt;body&gt;<br>
      &nbsp;&nbsp;[onshow.message] <br>
      &nbsp;&lt;/body&gt;<br>
      &lt;/html&gt;</span><br></td>
    <td valign="top" class="txt-code">&lt;?<br>
      <br>
      include_once(<span class="opt-value">'tbs_class.php'</span>);<br>
      <span class="opt-name">$TBS</span> =&amp; <strong>new</strong> clsTinyButStrong ;<br>
      <span class="opt-name">$TBS</span>-&gt;LoadTemplate(<span class="opt-value">'template.htm'</span>) ;<br>
      <br>
      $message = <span class="opt-value">'Hello'</span> ;<br>
      <span class="opt-name">$TBS</span>-&gt;Show() ;<br>
      <br>
      ?&gt; <br></td>
    <td valign="top" class="opt-html">&lt;html&gt;<br>
      &nbsp;&lt;body&gt;<br>
      &nbsp;&nbsp;Hello<br>
      &nbsp;&lt;/body&gt;<br>
      &lt;/html&gt;</td>
  </tr>
</table>
<br>
Example 2:<br>
<table width="100%" border="0" cellpadding="2" cellspacing="4">
  <tr class="title-1c">
    <td width="33%">Html Template</td>
    <td>Php Program</td>
    <td width="33%">Result</td>
  </tr>
  <tr class="norm">
    <td valign="top"><span class="opt-html">&lt;table&gt;<br>
      &nbsp;&lt;tr&gt;&lt;td&gt;[blk.val;block=tr]&lt;/td&gt;&lt;/tr&gt;<br>
      &lt;/table&gt;</span><br></td>
    <td valign="top" class="txt-code">&lt;?<br>
      <br>
      include_once(<span class="opt-value">'tbs_class.php'</span>);<br>
      <span class="opt-name">$TBS</span> =&amp; <strong>new</strong> clsTinyButStrong ;<br>
      <span class="opt-name">$TBS</span>-&gt;LoadTemplate(<span class="opt-value">'template.htm'</span>) ;<br>
      <br>
      $list = array(<span class="opt-value">'X'</span>,<span class="opt-value">'Y'</span>,<span class="opt-value">'Z'</span>) ;<br>
      <span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'blk'</span>,$list) ; <br>
      <span class="opt-name">$TBS</span>-&gt;Show() ;<br>
      <br>
      ?&gt; <br></td>
    <td valign="top" class="opt-html">&lt;table&gt;<br>
      &nbsp;&lt;tr&gt;&lt;td&gt;X&lt;/td&gt;&lt;/tr&gt;<br>
      &nbsp;&lt;tr&gt;&lt;td&gt;Y&lt;/td&gt;&lt;/tr&gt;<br>
      &nbsp;&lt;tr&gt;&lt;td&gt;Z&lt;/td&gt;&lt;/tr&gt;<br>
      &lt;/table&gt;</td>
  </tr>
</table>
<div class="title-3"><a name="php_side"></a>PHP side:</div>
The merging of a template is done in a PHP program using an object variable declared as a <span class="opt-html">clsTinyButStrong</span> class.<br>
Example of statement: <span class="txt-code"><span class="opt-name">$TBS</span> = <strong>new</strong> clsTinyButStrong ;</span> <br>
This object allows you to load a template, to handle the merging of it with data, and then to show the result.<br>
<br>
Example of PHP code:<br>
<br>
<div class="txt-code decal">include_once(<span class="opt-value">'tbs_class.php'</span>);<br>
  <span class="opt-name">$TBS</span> =&amp; <strong>new</strong> clsTinyButStrong ;<br>
  <span class="opt-name">$TBS</span>-&gt;LoadTemplate(<span class="opt-value">'template.htm'</span>) ;<br>
  <span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'ctry','mysql','SELECT * FROM t_country'</span>) ;<br>
  <span class="opt-name">$TBS</span>-&gt;Show() ; </div>
<br>
Here is the list of the TinyButStrong object's properties and methods:<br>
<br>
<div class="title-2"><a name="php_loadtemplate" id="php_loadtemplate"></a>method LoadTemplate():</div>
<div class="norm">Loads a template for the merging process.<br>
  The complete contents of the file is immediately stored in the <a href="#php_source">Source</a> property of the TBS object, then [onload] <a href="#html_field_auto">fields</a> and <a href="#html_block_auto">blocks</a> are merged.<br>
  If the file is not found, then it will also be searched in the folder of the last loaded template  (<span class="versioning">since TBS version 3.2.0</span>).<br>
  <br>
  Syntax: <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;LoadTemplate(<span class="opt-type">string</span> <span class="opt-name">File</span><span class="opt-name"><font color="#333333">{</font></span>, <span class="opt-type">string</span><span class="opt-name"> Charset<font color="#333333">}</font></span>)<br>
  <br>
  </span>
  <table border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="80" align="left" valign="top">Argument</td>
      <td align="left" valign="top">Description</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">File</td>
      <td align="left" valign="top">Local or absolute path of the file to load.<br>
        This value can be <span class="opt-value">null</span> or <span class="opt-value">''</span> (empty string) for special actions. See below for more details. </td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">Charset</td>
      <td align="left" valign="top">Optional. Indicates the character encoding (charset) to use for conversion of special characters   when data  will be merged. It should be the same as the charset of the template. The default value is <span class="opt-value">''</span> (empty string) which is equivalent to <span class="opt-value">'ISO-8859-1'</span> (Latin 1).<br>
        <br>
        If your template uses a special charset, then indicate the Html value for this charset.<br>
        In a Html page, the charset is placed at the beginning of the file, in the attribute <span class="opt-html">'content'</span> of a <span class="opt-html">&lt;Meta&gt;</span> tag. The charsets supported by TBS are the charsets supported by the PHP function <a href="http://www.php.net/htmlentities" target="_blank">htmlentities()</a>. For example: <span class="opt-value">'BIG5'</span> (Chinese) or <span class="opt-value">'EUCJP'</span> (Japanese).<br>
        <br>
        See below for more possibilities.</td>
    </tr>
  </table>
  <br>
  <span class="title-1b">Scope of the file path:</span><br>
  If the file is nout found then its' also searched into the directory of the last loaded template, or the last loaded subtemplate. <br>
  <span class="versioning">Since TBS version 3.3.0</span>, the file also searched into the <a href="http://www.php.net/manual/en/ini.core.php#ini.include-path">include_path</a>.<br>
  <br>
  <span class="title-1b">No character conversion:</span> <br>
  If you use value <span class="opt-value">False</span> as the argument <span class="opt-name">Charset</span>, data will to not be converted when merged into the model.<br>
  Note that parameters <a href="#html_field_prm_htmlconv" class="opt-name">htmlconv</a> can be use to define the conversion of special characters for one TBS field only. <br>
  <br>
  <span class="title-1b">User function:</span> <br>
  If your charset is not yet supported by PHP, you can indicate a user function that will perform the  conversion of special characters. For this, use the argument <span class="opt-name">Charset</span> with the syntax '=myfunction'.<br>
  <span class="versioning">Since TBS version 3.0</span>, it's also possible to indicate a method of a class (see <a href="#php_oop">OOP</a>).<br>
  <span class="versioning">Since TBS version 3.3.0</span>, such a custom function should have a second argument for line break conversion.<br>
  <span class="versioning">Since TBS version 3.5.0</span>, argument Charset can also be an array containing an object and a method. Example: array(&amp;$obj, 'mymethod'). <br>
  Here is an example which gives the expected syntaxe: <br>
  <div class="decal txt-code">function f_StrToXml(<span class="opt-name">$Txt</span> <span class="opt-type">string</span>,<span class="opt-name">$ConvBr <span class="opt-type">boolean</span></span>) {<br>
    <span class="opt-html">// Convert a string into an XML text.</span><br>
    &nbsp;&nbsp;<span class="opt-type"><span class="opt-name">$x</span></span> = htmlspecialchars(utf8_encode(<span class="opt-name">$Txt</span>));<br>
    &nbsp;&nbsp;if (<span class="opt-name">$ConvBr</span>) {<br>
    &nbsp;&nbsp;  &nbsp;<span class="opt-name">$x</span> = nl2br(<span class="opt-name">$x</span>); <span class="opt-html">// Convert any type of line break</span><br>
    &nbsp;&nbsp;&nbsp;&nbsp;<span class="opt-name">$x</span> = str_replace(<span class="opt-value">'&lt;br /&gt;'</span>, <span class="opt-value">'&lt;text:line-break/&gt;'</span>,<span class="opt-name">$x</span>);<br>
    &nbsp;&nbsp;return <span class="opt-name">$x</span>; <br>
    } </div>
  <span class="title-1b"><br>
  Adding the file at the end of the current template:</span><br>
  You can use the keyword <span class="opt-value">'+'</span> instead of the the charset to have the file added to the end of the current template. Charset parameter stay the same as for the first template.<br>
  <br>
  <span class="title-1b">Special actions:</span><br>
  <span class="versioning">Since TBS version 3.4.0.<br>
  </span> If <span class="opt-name">File</span> is <span class="opt-value">null</span>, then all default actions (Plug-ins, [onload] tags, and Charset) are applyied without loading any file. <br>
  If <span class="opt-name">File</span> is <span class="opt-value">''</span> (empty string), then only the charset is modified, without doing any other action.<br>
  Example: <br>
  <div class="decal txt-code"><span class="opt-name">$TBS</span>-&gt;Source = <span class="opt-name">$template</span>; <span class="opt-html">// load the template from a string</span> <br>
    <span class="opt-name">$TBS</span>-&gt;LoadTemplate(<span class="opt-value">null</span>,<span class="opt-value">'BIG5'</span>); <span class="opt-html">//  run plug-ins if any, and merges [onload] tags if any</span><br>
    ...<br>
    <span class="opt-name">$TBS</span>-&gt;LoadTemplate(<span class="opt-value">''</span>,<span class="opt-value">false</span>); <span class="opt-html">// turn the charset to no-charset</span> </div>
  <br>
</div>
<div class="title-2"><a name="php_mergeblock" id="php_mergeblock"></a>method MergeBlock():</div>
<div class="norm">Merges one or several <a href="#html_block">TBS blocks</a> with records coming from a data source.<br>
  by default, this method returns the number of merged records (more exactly, it is the number of the last record), but it can also return the full merged record set (see argument <span class="opt-name">BlockName</span>).<br>
  <br>
  TinyButStrong supports several data source types in native:<br>
  <span class="title-1b">Php data</span>: an array, a string, a number.<br>
  <span class="title-1b">Databases:</span> MySQL ; PostgreSQL ; SQLite.<br>
  You can also add a new one: '<a href="#plugins_db">database plug-ins</a>'.<br>
  <br>
  Syntax: <span class="txt-code"><span class="opt-type">int</span><span class="opt-name"></span> <span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-type">string</span><span class="opt-name"> BlockName</span>, <span class="opt-type">mixed</span> <span class="opt-name">Source<font color="#333333">{</font></span>, <span class="opt-type">string</span><span class="opt-name"> Query<font color="#333333">}</font></span>)</span>
  <table border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="80" align="left" valign="top">Argument</td>
      <td width="0" align="left" valign="top">Description</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">BlockName</td>
      <td align="left" valign="top">Indicates the name of the TBS <a href="#html_block">block</a> to merge.<br>
        You can merge several blocks with the same data by indicating their names separated by commas. If you add <span class="opt-value"> '*'</span> as a block name, then the method will return the full merged record set as a PHP array, instead of the number of records.
        <div class="versioning">Versioning: the keyword  '*' is supported since TBS version 3.0.</div></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">Source</td>
      <td align="left" valign="top"><p>Indicates the data source to merge.<br>
          The table below shows the possible values according to the data source type.</p></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">Query</td>
      <td align="left" valign="top"> Optional. Indicates the SQL statement which returns the records to merge.<br>
        The table below shows the possible values according to the data source type.</td>
    </tr>
  </table>
  <div class="title-1b"><br>
    Link between the block and the records:</div>
  <br>
  <div class="decal"> The MergeBlock() method searches in your template for the specified TBS block name. Then, the block is repeated as many times as there are records in the data source.<br>
    To display the data of a record, you have to use a linked TBS Field. A TBS Field is linked when the name of it is composed of the block's name followed by a dot and a column's or a key's name in the record set. A linked field must be inside the block.<br>
    <br>
    Example:<br>
    <div class="decal"> Block's name: <span class="opt-value">block1</span><br>
      Columns returned by the query: <span class="opt-value">field1</span>,<span class="opt-value">field2</span>,<span class="opt-value">field3</span><br>
      Linked TBS Fields: <span class="opt-value"> [block1.field1]</span>, <span class="opt-value">[block1.field2]</span>, <span class="opt-value">[block1.field3]</span></div>
    <br>
    If no block's definition is found in the template, then the MergeBlock() method will merge the first record with all linked fields found in the template.<br>
    <br>
    You can also define more advanced blocks. For more information, refer to chapter <a href="#html_block">TBS Blocks</a>.</div>
  <br>
  <span class="title-1b"><a name="php_mergeblock_mergeseveral" id="php_mergeblock_mergeseveral"></a>Merging several blocks with the same data:</span> <br>
  <div class="decal"><br>
    You can merge several blocks with the same data by indicating their names separated by commas in the <span class="opt-name">BlockName</span> parameter. In this case, the query is opened only one time, and records are buffered to feed blocks.<br>
    Example: <span class="opt-name"><span class="txt-code">$TBS</span></span><span class="txt-code">-&gt;MergeBlock(<span class="opt-value">'block1,block2,block3'</span>,<span class="opt-value">'mysql'</span>,<span class="opt-value">'SELECT * FROM MyTable'</span>);</span><br>
    <br>
    You cannot merge  several blocks having the same names because 
    they are considered by TBS has a one and only  block composed of several sections. Nevertheless, you can use a tip to get a similar behavior. If you use parameter <a href="#html_block_prm_p1" class="opt-name">p1</a> without value in the block definition, that does forces TBS to consider the section as a  new block break, like it does for <a href="#html_block_dynsb">subblocks</a>.<br>
    Example:<br>
    <div class="decal">
      <table border="0" cellspacing="5" cellpadding="0">
        <tr>
          <td><table border="1" cellspacing="0" cellpadding="1">
              <tr class="title-1c">
                <td bgcolor="#66CCFF">Id</td>
                <td bgcolor="#66CCFF">Name</td>
              </tr>
              <tr>
                <td>[b.id;block=tr;p1]</td>
                <td>[b.name]</td>
              </tr>
            </table></td>
          <td><table border="1" cellspacing="0" cellpadding="1">
              <tr class="title-1c">
                <td bgcolor="#FFCC66">Id</td>
                <td bgcolor="#FFCC66">Name</td>
              </tr>
              <tr>
                <td>[b.id;block=tr;p1]</td>
                <td>[b.name]</td>
              </tr>
            </table></td>
        </tr>
      </table>
      <br>
      <span class="opt-name"><span class="txt-code">$TBS</span></span><span class="txt-code">-&gt;MergeBlock(<span class="opt-value">'b'</span>,<span class="opt-value">'mysql'</span>,<span class="opt-value">'SELECT * FROM MyTable'</span>);</span> </div>
    <div class="versioning">Versioning: this tip is available since TBS version 3.4. </div>
  </div>
  <span class="title-1b"><br>
  <a name="php_mergeblock_returndata" id="php_mergeblock_mergeseveral2"></a>Returning the full merged record set:</span>
  <div class="decal"><br>
    In some cases, it may be useful for you to retrieve the full  record set after the merge. For that, you simply have to ad the keyword <span class="opt-value">'*'</span> in the list of block's names. Use this feature with care, because it save the merged data in the memory which can take resources.<br>
    Example: <span class="opt-name">$data</span> = <span class="opt-name"><span class="txt-code">$TBS</span></span><span class="txt-code">-&gt;MergeBlock(<span class="opt-value">'block1,*'</span>,<span class="opt-value">'mysql'</span>,<span class="opt-value">'SELECT * FROM MaTable'</span>);</span></div>
  <span class="title-1b"></span><br>
  <span class="title-1b"><a name="php_mergeblock_counting"></a>Counting the records:</span><br>
  <div class="decal"><br>
    To display the number of the record in the template, use a TBS Field linked to the virtual column '<span class="opt-value">#'</span>. 
    If you put this field outside the block, it will display the total number of records.<br>
    Example: <span class="opt-value">[block1.#]<br>
    </span><br>
    The virtual column '<span class="opt-value">$'</span> will display the key of the current record if the data source is a Php array.<br>
    Example: <span class="opt-value">[block1.$]</span></div>
  <div class="title-1b"><br>
    Resource and Request arguments according to the data source type:</div>
  <br>
  <table cellpadding="2" cellspacing="0" class="border-0">
    <tr bgcolor="#B2B2B2" class="title-1c">
      <td width="110" class="border-0">Data Source Type</td>
      <td width="200" class="border-0">Source</td>
      <td width="200" class="border-0">Query<span class="txt-code"><span class="opt-name"></span></span></td>
    </tr>
    <tr valign="top">
      <td class="border-0">Assigned <span class="txt-tiny">(*)</span></td>
      <td class="border-0">The keyword <span class="opt-value">'assigned'</span> or omitted</td>
      <td class="border-0">-</td>
    </tr>
    <tr valign="top">
      <td class="border-0">Text <span class="txt-tiny">(*)</span></td>
      <td class="border-0">The keyword <span class="opt-value">'text'</span></td>
      <td class="border-0">A text</td>
    </tr>
    <tr valign="top">
      <td class="border-0">Number <span class="txt-tiny">(*)</span></td>
      <td class="border-0">The keyword <span class="opt-value">'num'</span></td>
      <td class="border-0">A number or a special array (see below)</td>
    </tr>
    <tr valign="top">
      <td class="border-0">Clear<span class="txt-tiny"> (*)</span></td>
      <td class="border-0">The keyword <span class="opt-value">'clear'</span></td>
      <td class="border-0">-</td>
    </tr>
    <tr valign="top">
      <td class="border-0">Conditional<span class="txt-tiny"> (*)</span></td>
      <td class="border-0">The keyword <span class="opt-value">'cond'</span></td>
      <td class="border-0">-</td>
    </tr>
    <tr valign="top">
      <td rowspan="3" class="border-0"> PHP Array <span class="txt-tiny">(*)</span></td>
      <td class="border-0">A Php array</td>
      <td class="border-0">-</td>
    </tr>
    <tr>
      <td valign="top" class="border-0">The keyword <span class="opt-value">'array'</span></td>
      <td valign="top" class="border-0">A Php Array</td>
    </tr>
    <tr>
      <td valign="top" class="border-0">The keyword <span class="opt-value">'array'</span></td>
      <td valign="top" class="border-0">A string that represents an array contained or nested in a PHP global variable (see below)</td>
    </tr>
    <tr>
      <td class="border-0">PHP&nbsp;ArrayObject</td>
      <td rowspan="3" valign="top" class="border-0">A PHP object.<br>
        <span class="versioning">Supported in native since TBS version 3.5.0.</span></td>
      <td rowspan="3" valign="top" class="border-0">-</td>
    </tr>
    <tr>
      <td class="border-0">PHP&nbsp;Iterator</td>
    </tr>
    <tr>
      <td class="border-0">PHP&nbsp;IteratorAggregate</td>
    </tr>
    <tr valign="top">
      <td rowspan="2" class="border-0">MySQL</td>
      <td class="border-0">A MySql connection identifier or the keyword <span class="opt-value">'mysql'</span></td>
      <td class="border-0">An SQL statement</td>
    </tr>
    <tr>
      <td class="border-0">A MySql result identifier</td>
      <td class="border-0">-</td>
    </tr>
    <tr valign="top">
      <td rowspan="2" class="border-0">PostgreSQL</td>
      <td class="border-0">A PostgreSql connection identifier</td>
      <td class="border-0">An SQL statement</td>
    </tr>
    <tr>
      <td class="border-0">A PostgreSql result identifier</td>
      <td class="border-0">-</td>
    </tr>
    <tr valign="top">
      <td rowspan="2" class="border-0">SQLite</td>
      <td class="border-0">An SQLite connection identifier</td>
      <td class="border-0">An SQLite statement</td>
    </tr>
    <tr>
      <td class="border-0">An SQLite result identifier</td>
      <td class="border-0">-</td>
    </tr>
    <tr valign="top">
      <td class="border-0">custom<br></td>
      <td class="border-0">A keyword, an object or a resource identifier not mentioned in this table.<br>
        See the chapter '<a href="#plugins_db">database plug-ins</a>'.</td>
      <td class="border-0">An SQL statement or something else.</td>
    </tr>
  </table>
  <span class="txt-tiny">(*) See explanations in the chapter below.<br>
  </span> <br>
  <div class="title-1b"> Php data sources:</div>
  <br>
  <div class="decal"><span class="title-1c"> Assigned<br>
    </span>
    <div class="decal">The argument <span class="opt-name">Source</span> has to be equal to <span class="opt-value">'assigned'</span> or be omitted.<br>
      The block is merged with the arguments defined in the property <a href="#php_assigned">Assigned</a>.<br>
      Example : <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'b1'</span>);</span><br>
      <div class="versioning">Versioning: the keyword  'assigned' is supported since TBS version 3.5. </div>
    </div>
    <br>
    <span class="title-1c">Text</span>
    <div class="decal">The argument <span class="opt-name">Source</span> has to be equal to <span class="opt-value">'text'</span>.<br>
      The whole block is replaced by the text (it must be a string) given as the <span class="opt-name">Query</span> argument. No linked Fields are processed except '<span class="opt-value">#'</span> which returns 1, or 0 if <span class="opt-name">Query</span> is an empty string.<br>
      Example: <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'b1'</span>,<span class="opt-value">'text'</span>,<span class="opt-value">'Hello, how are you?'</span>); </span></div>
    <br>
    <span class="title-1c"> Number</span>
    <div class="decal">The argument <span class="opt-name">Source</span> has to be equal to <span class="opt-value"></span> <span class="opt-value">'num'</span>.<br>
      The argument <span class="opt-name">Query</span> can be either a number or an array.<br>
      <br>
      <table border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="80" class="title-1b">arg&nbsp;Query</td>
          <td class="title-1b">Returned Record Set</td>
        </tr>
        <tr>
          <td valign="top">Number:</td>
          <td>This number has to be positive or equal to zero. The returned Record Set consists of a column <span class="opt-value">'val'</span> where the value goes from 1 to this number.</td>
        </tr>
        <tr>
          <td valign="top">Array:</td>
          <td>This array has to contain a key <span class="opt-value">'min'</span> and a key <span class="opt-value">'max'</span> and eventually a key <span class="opt-value">'step'</span>.<br>
            The returned Record Set consists of a column <span class="opt-value">'val'</span> which goes from the <span class="opt-value">'min'</span> value to the <span class="opt-value">'max'</span> value.</td>
        </tr>
      </table>
      Examples:<br>
      <div class="decal"><span class="txt-code"><span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'b1'</span>,<span class="opt-value">'num'</span>,<span class="opt-value">12</span>);</span><br>
        <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'b2'</span>,<span class="opt-value">'num'</span>,array(<span class="opt-value">'min'</span>=&gt;<span class="opt-value">20</span>,<span class="opt-value">'max'</span>=&gt;3<span class="opt-value">0</span>));</span><br>
        <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'b3'</span>,<span class="opt-value">'num'</span>,array(<span class="opt-value">'min'</span>=&gt;<span class="opt-value">10</span>,<span class="opt-value">'max'</span>=&gt;<span class="opt-value">20</span>,<span class="opt-value">'step'</span>=&gt;<span class="opt-value">2</span>));</span></div>
    </div>
    <br>
    <span class="title-1c">Clear</span><br>
    <div class="decal">The argument <span class="opt-name">Source</span> has to be the keyword <span class="opt-value">'clear'</span>.<br>
      All blocks and sections are deleted. It is the same thing as merging with an empty array.<br>
      Example: <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'b1'</span>,<span class="opt-value">'clear'</span>); </span></div>
    <br>
    <span class="title-1c">Conditional</span><br>
    <div class="decal">The argument <span class="opt-name">Source</span> has to be the keyword<span class="opt-value">'cond'</span>.<br>
      The block is merged like it was a <span class="opt-name"> <a href="#html_conditional_section">conditional blocks</a> onload</span> and <span class="opt-name">onshow</span>. The block is not merged with data, and so it must have no linked TBS field. Each block section needs a parameter <span class="opt-name">when</span> or a parameter <span class="opt-name">default</span>. See <a href="#html_conditional_section">conditional blocks</a> for more details.<br>
      Example: <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'bz'</span>,<span class="opt-value">'cond'</span>);</span></div>
    <br>
    <span class="title-1c"> Array</span>
    <div class="decal">The argument <span class="opt-name">Source</span> has to be a PHP Array or the keyword <span class="opt-value">'array'</span>. If you use the keyword <span class="opt-value">'array'</span>, then the argument <span class="opt-name">Query</span> has to be a Php Array or a string that represents an array contained or nested in a global variable.<br>
      <br>
      <span class="title-1b">String syntax:</span> <span class="opt-value">'globvar[item1][item2]...'</span><br>
      <div class="decal">'globvar' is the name of a global variable $globvar which must be an array.<br>
        'item1' and 'item2' are the keys of an item or a subitem of $globvar.<br>
        Example:<br>
        <div class="decal"> <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'block1'</span>,<span class="opt-value">'array'</span>,<span class="opt-value">'days[mon]'</span>);</span><br>
          This will merge 'block1' with the value $day['mon'] assuming it is an array. </div>
        It is possible to represent variable's name without items.<br>
        Example:<br>
        <div class="decal"> <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'block1'</span>,<span class="opt-value">'array'</span>,<span class="opt-value">'days'</span>);</span></div>
      </div>
      <br>
      There are two advantages in using a string to represent the array:<br>
      -&gt; Items will be read directly in the Array (assigned by reference) instead of reading a copy of the items. This can improve the performance.<br>
      -&gt; You can use dynamic queries. <br>
      <br>
      <span class="title-1b">Displaying the key of current record:</span><br>
      You can use the virtual column '<span class="opt-value">$'</span> which will display the key of the current record. This can be useful especially for <a href="#html_block_dynsb">subblocks with dynamic queries</a>. <br>
      Example: [block1.$]<br>
      <span class="title-1b"><br>
      Structure of supported arrays: </span><br>
      Items of the specified Array can be of two kinds: simple values with associated keys (case&nbsp;1), or array values for whom items are themselves simple values with associated keys (case&nbsp;2).<br>
      <br>
      Case 1:<br>
      <table  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="80" valign="top">Example: </td>
          <td valign="top">['key1']=&gt;value1<br>
            ['key2']=&gt;value2<br>
            ...</td>
        </tr>
      </table>
      The returned Record Set consists of a column <span class="opt-value">'key'</span> containing the name of the key, and a column <span class="opt-value">'val'</span> containing the value of the key.<br>
      <br>
      Case 2: <br>
      <table  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="80" valign="top">Example: </td>
          <td valign="top">[0] =&gt; (['column1']=&gt;value1-0 ; ['column2']=&gt;value2-0 ; ...)<br>
            [1] =&gt; (['column1']=&gt;value1-1 ; ['column2']=&gt;value2-1 ; ...)<br>
            [2] =&gt; (['column1']=&gt;value1-2 ; ['column2']=&gt;value2-2 ; ...)<br>
            ...</td>
        </tr>
      </table>
      The returned Record Set consists of the columns <span class="opt-value">'column1'</span>, <span class="opt-value">'column2'</span>,... with their associated values.<br>
      <br>
    </div>
  </div>
</div>
<div class="title-2"><a name="php_show" id="php_show"></a>method Show():</div>
<div class="norm">Terminates the merge.<br>
  <br>
  Syntax: <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;Show(<span class="opt-name"><font color="#333333">{</font></span><span class="opt-type">int</span><span class="opt-name"> </span><span class="opt-name">Render</span><span class="opt-name"></span><span class="opt-name"><font color="#333333">}</font></span>)</span><br>
  <br>
  The Show() method  performs the following actions:<br>
  - Merge [var] <a href="#html_field_auto">fields</a> (for compatibility with  version prior to 3.2.0),<br>
  - Merge [onshow] <a href="#html_field_auto">fields</a> and <a href="#html_block_auto">blocks</a>,<br>
  - Display the result (this action can be cancelled by <a href="#php_render">Render</a> property/argument),<br>
  - End the script (this action can be cancelled by <a href="#php_render">Render</a> property/argument). <br>
  <br>
  The <a href="#php_render">Render</a> property/argument allows to adjust the behavior of the Show() method. See the <a href="#php_render">Render</a> property for more information.</div>
<div class="title-2"><a name="php_getblocksource" id="php_getblocksource"></a>method GetBlockSource():</div>
<div class="norm">Returns the source of a TBS Block from the template.<br>
  If no block is found, the method returns <span class="txt-code"><em><font color="#0033CC">False</font></em></span>.<br>
  <br>
  Syntax: <span class="txt-code"><span class="opt-type">string</span> <span class="opt-name"></span><span class="opt-name">$TBS</span>-&gt;GetBlockSource(<span class="opt-type">string </span><span class="opt-name">BlockName </span>{,<span class="opt-type"> boolean</span> <span class="opt-name">Sections</span>}{,<span class="opt-type"> boolean</span> <span class="opt-name">DefTags</span>}{,<span class="opt-type"> mix</span> <span class="opt-name">ReplaceWith</span>})</span> <br>
  <br>
  <table border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="80" align="left" valign="top">Argument</td>
      <td align="left" valign="top">Description</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">BlockName</td>
      <td align="left" valign="top">The name of the block to search for.<br></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">AsArray</td>
      <td align="left" valign="top">Optional. The default value is <span class="txt-code"><em><font color="#0033CC">False</font></em></span>.        If this parameter is <span class="txt-code"><em><font color="#0033CC">True</font></em></span> the method returns the source of the block as a PHP array instead of a  string. If the result is an array, then each sections of the block is saved as an item. First item is index 1.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">DefTags</td>
      <td align="left" valign="top">Optional. The default value is<span class="txt-code"><em><font color="#0033CC"> True</font></em></span>. By default, the method  GetBlockSource() returns the source of the block including its definition tags. If you'd like those tags to be deleted, then force the argument <span class="opt-name">DefTags</span> to <em><font color="#0033CC">False</font></em>. If the block is defined with a <a href="#html_block">simplified syntax</a> then the definition tags will not be deleted anyway because they are also Field tags.<br>
        <div class="versioning">Versioning: this argument is supported since TBS version 3.0.</div></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">ReplaceWith</td>
      <td align="left" valign="top">Optional. Default value is <em><font color="#0033CC">False</font></em>.        If this argument is a string then 
        the block source is replaced with it in the template. You can use <span class="opt-name">ReplaceWith</span> = <span class="opt-value">''</span> (empty string) in order to delete the block source from the template.<br>
        <div class="versioning">Versioning: this argument is supported since TBS version 3.05.</div></td>
    </tr>
  </table>
  <span class="txt-code"> </span><br>
  This method enables you to get the source of a block in order to manually handle the merging.<br>
  After that, if you need to replace the block with text, you can use the <a href="#php_mergeblock">MergeBlock()</a> method with the '<span class="opt-value">text</span>' parameter.<br>
  <div class="versioning">Versioning: Since TBS 3.05 if <span class="opt-name">AsArray</span> is <span class="opt-type">False</span> then the method returns block with all its sections ; before TBS 3.05 it return only the first section. Since TBS 3.05 if <span class="opt-name">AsArray</span> is <span class="opt-type">True</span> and the block is not found then the  method returns <span class="opt-type">False</span> ; before TBS 3.05 it return an empty Array.</div>
</div>
<div class="title-2"><a name="php_mergefield" id="php_mergefield"></a>method MergeField():</div>
<div class="norm">Replaces one or several TBS Fields with a fixed value or by calling a user function.<br>
  Since TBS version 3.0, it's also possible to indicate a method of a class (see <a href="#php_oop">OOP</a>).<br>
  Each TBS fields having the specified base name will be merged.<br>
  It is also possible to merge the special   [onload],  [onshow] and [var] (see below).<br>
  <br>
  Syntax: <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;MergeField(<span class="opt-type">string </span><span class="opt-name">BaseName</span>,<span class="opt-type"> mixed</span></span><span class="txt-code"> <span class="opt-name">X</span><span class="opt-name"> </span>{,<span class="opt-type"> boolean</span> <span class="opt-name">FunctionMode</span>}{, <span class="opt-type">array</span> <span class="opt-name">DefaultPrm</span>})</span> <br>
  <br>
  <table border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="80" align="left" valign="top">Argument</td>
      <td align="left" valign="top">Description</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">BaseName</td>
      <td align="left" valign="top">Base name of the TBS Fields. For example <span class="opt-value">'account'</span>.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">X</td>
      <td align="left" valign="top">The value to display (or a string that represent the name of a user function if the argument <span class="opt-name">FunctionMode</span> is set to <span class="opt-value">true</span>).</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">FunctionMode</td>
      <td align="left" valign="top">Indicates that the value to display is calculated by a user function. The default value is <span class="opt-value">false</span>. If this argument is set to <span class="opt-value">true</span>, then <span class="opt-name">X</span> must be a text string giving the name of the user function. This function must exist and have the syntax described below.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">DefaultPrm</td>
      <td align="left" valign="top"><p>List of parameters to apply by default to the merged fields. Parameters have to be given as an associative PHP array. If a parameter is defined in both argument DefaultPrm and in the field, then the parameter of the field will be taken in account.<br>
          <span class="versioning">This argument is supported since TBS version 3.5.0.</span><br>
        </p></td>
    </tr>
  </table>
  <br>
  <span class="title-1b">Merging with a value:</span><br>
  <br>
  <span class="opt-name">X</span> can be numeric, string, an array or an object. For an array or an object, names of TBS Fields must have suffixes like <a href="#html_field_auto">automatic fields ([onload] and [onshow])</a>.<br>
  <br>
  Example:<br>
  <div class="decal">
    <div class="txt-code"><span class="opt-name">$TBS-&gt;</span>MergeField(<span class="opt-value">'account'</span>,array(<span class="opt-value">'id'</span>=&gt;<span class="opt-value">55</span>,<span class="opt-value">'name'</span>=&gt;<span class="opt-value">'Bob'</span>));<br>
    </div>
    <div class="txt-small">In this example, the fields <span class="opt-value"></span>[account.id] and [account.name] will be merged.</div>
  </div>
  <br>
  <span class="title-1b">Merging with a user function:</span><br>
  <br>
  TBS calls this function for each field found in the template.<br>
  This function must have the following syntax:<br>
  <div class="decal txt-code">function fct_user(<span class="opt-name">$Subname</span> [, <span class="opt-name">$PrmLst</span>]) {...}</div>
  When the function is called, its argument <span class="opt-name">$Subname</span> has for value the suffix of the field's name (example: for a field named <span class="opt-value">'ml.title'</span>, <span class="opt-name">$Subname</span> will have the value <span class="opt-value">'title')</span>. And the optional argument <span class="opt-name">$PrmLst</span> contains an associative array with the field's parameters. The function must return the value to be merged. <br>
  <br>
  Example: <br>
  <div class="decal">
    <div class="txt-code"><span class="opt-name">$TBS-&gt;</span>MergeField(<span class="opt-value">'ml'</span>,<span class="opt-value">'m_multilanguage'</span>,<span class="opt-value">true</span>);<br>
      ...<br>
      function m_multilanguage(<span class="opt-name">$Subname</span>) {<br>
      &nbsp;&nbsp;global <span class="opt-name">$lang_id</span>; <br>
      &nbsp;&nbsp;<span class="opt-name">$rs</span> = mysql_query(<span class="opt-value">&quot;SELECT text_$lang_id AS txt FROM t_language WHERE key='$Subname&quot;</span>);<br>
      &nbsp;&nbsp;<span class="opt-name">$rec</span> = mysql_fetch_array(<span class="opt-name">$rs</span>);<br>
      &nbsp;&nbsp;return <span class="opt-name">$rec</span>[<span class="opt-value">'txt'</span>] ;<br>
      }</div>
    <div class="txt-small">In this example, a field such as <span class="opt-value">[ml.title]</span> will be merged with the value returned by <span class="opt-value">m_multilanguage('title')</span>.</div>
  </div>
  <span class="title-1b"><br>
  Merge automatic fields and blocks:</span><br>
  <br>
  You can use the method  MergeField() in order to force the merge of the automatic <a href="#html_field_auto">fields</a> and <a href="#html_block_auto">blocks</a> ([onload] and [onshow]). But in this case, only the first argument should be indicated.<br>
  Example: <span class="txt-code"><span class="opt-name">$TBS-&gt;</span>MergeField(<span class="opt-value">'var'</span>);<br>
  </span>
  <div class="versioning">Versioning: the merge of special fields is supported since TBS version 3.0. It replaces the old method MergeSpecial() which is not supported anymore. </div>
</div>
<div class="title-2"><a name="php_plugin" id="php_plugin"></a>Method PlugIn():</div>
<div class="norm">Enables you to call a <a href="#plugins_tbs">TBS plug-in</a>'s command, or to install a TBS plug-in. <br>
  <br>
  Syntax: <span class="opt-type"><span class="txt-code">mixed</span></span> <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;PlugIn(<span class="opt-type"><span class="opt-value">mixed</span></span> arg1, <span class="opt-type">mixed</span> arg2, ...)</span><br>
  <br>
  <span class="title-1b">Remind:</span> in order to have your TBS plug-in working, its PHP script must be included in your application before.<br>
  Example: <span class="txt-code"><span class="opt-name">include_once</span>(<span class="opt-value">'tbs_plugin_xxx.php'</span>); </span><br>
  And aslo, every TBS plug-in should have a key as explained at <a href="#plugins_tbs">Plug-ins</a>.<br>
  <br>
  <span class="title-1c">Calling a plug-in's command:</span><br>
  Use the plug-in's key as the main argument. Next arguments are for the called plug-in's purpose. <br>
  Example: <br>
  <div class="decal">
    <div class="txt-code"><span class="opt-name">$TBS-&gt;</span>PlugIn(<span class="opt-value">TBS_XXX</span>,<span class="opt-name">$arg1</span>,<span class="opt-name">arg2</span>);</div>
    <span class="txt-small">In this example, the plug-in identified by the key TBS_XXX is called.</span></div>
  <span class="title-1b">Remark:</span> when you call a plug-in's command for the first time this plug-in is automatically installed on the TBS instance (<span class="opt-name">$TBS</span>).<br>
  <br>
  <span class="title-1c">Installing a plug-in: </span><br>
  Although some plug-ins are automatically installed, it can be useful in some other cases to  make a manual installation. For this, use the constant TBS_INSTALL with the plug-in's key.<br>
  Example: <br>
  <br>
  <div class="decal">
    <div class="txt-code"><span class="opt-name">$TBS-&gt;</span>PlugIn(<span class="opt-value">TBS_INSTALL</span>,<span class="opt-value">TBS_XXX</span>);</div>
    <span class="txt-small">In this example, the plug-in identified by the key TBS_XXX is installed.</span></div>
  <span class="title-1b">Remarks:</span><br>
  * A plug-in is installed relatively to a  TBS instance (a variable $TBS for example). If you are using a second TBS instance (for example <span class="opt-name">$TBS2</span>) then you will also need to install the plug-in on this instance. <br>
  * 
  A plug-in is installed automatically when you call one of its commands using the method  PlugIn() (se above).<br>
  <br>
  <br>
  <div class="versioning">Versioning: the method PlugIn()  is supported since TBS version 3.0. </div>
</div>
<div class="title-2"><a name="php_assigned" id="php_assigned"></a>Property Assigned:</div>
<div class="norm"> Enables you to define information for a subsequent  merging which can be automatic or manual.<br>
  <br>
  Syntax: <span class="txt-code"><span class="opt-type">array</span> <span class="opt-name">$TBS</span>-&gt;Assigned</span><br>
  <br>
  Property Assigned is a PHP array defined by the user. Arguments for methods MergeBlock() and MergeField() can be saved there. Arguments have to be saved in a PHP array with numerical keys and ordered following the syntax of those methods. It is possible to use optional string keys in order to define specific behaviors: <br>
  <table border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td>Optional key</td>
      <td>Description</td>
    </tr>
    <tr>
      <td valign="top" nowrap><span class="opt-value">'type'</span>=&gt;<span class="opt-value">'mergeblock'</span></td>
      <td>Indicates that arguments are for the MergeBlock() method. This key is optional because it is the default behavior.</td>
    </tr>
    <tr>
      <td valign="top" nowrap><span class="opt-value">'type'</span>=&gt;<span class="opt-value">'mergefield'</span></td>
      <td>Indicates that arguments are for the MergeField() method.</td>
    </tr>
    <tr>
      <td valign="top" nowrap><span class="opt-value">'auto'</span>=&gt;<span class="opt-value">'onload'</span></td>
      <td>Indicates that the merging must be started automatically after  [onload] tags.</td>
    </tr>
    <tr>
      <td valign="top" nowrap><span class="opt-value">'auto'</span>=&gt;<span class="opt-value">'onshow'</span></td>
      <td>Indicates that the merging must be started automatically after  [onshow] tags.</td>
    </tr>
    <tr>
      <td valign="top" nowrap><span class="opt-value">'merged'</span>=&gt;<span class="opt-value">0</span></td>
      <td>This key is added automatically by TBS during the merging. It counts the number of times this entry was merged.</td>
    </tr>
  </table>
  <br>
  Example of a manual merging: <br>
  <div class="decal">
    <div class="txt-code"><span class="opt-name">$TBS</span>-&gt;Assigned[<span class="opt-value">'b'</span>] = array(<span class="opt-value">'b1,b2'</span>, &amp;<span class="opt-name">$cnt_id</span>, <span class="opt-value">'SELECT id, name FROM table1'</span>);<br>
      ... <br>
      <span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'b'</span>); <span class="opt-html">// merge block b1 and b2 with the SQL query</span><br>
      <br>
    </div>
  </div>
  Example of an automatic merging: <br>
  <div class="decal">
    <div class="txt-code"><span class="opt-name">$TBS</span>-&gt;Assigned[<span class="opt-value">'b'</span>] = array(<span class="opt-value">'b1,b2'</span>, &amp;<span class="opt-name">$cnt_id</span>, <span class="opt-value">'SELECT id, name FROM table1'</span>, <span class="opt-value">'auto'</span>=&gt;<span class="opt-value">'onload'</span>); </div>
  </div>
  <br>
  Example of merging fields: <br>
  <div class="decal">
    <div class="txt-code"><span class="opt-name">$TBS</span>-&gt;Assigned[<span class="opt-value">'f1'</span>] = array(<span class="opt-value">'f1'</span>, <span class="opt-name">$data</span>, <span class="opt-value">'type'</span>=&gt;<span class="opt-value">'mergefield'</span>);<br>
      ... <br>
      <span class="opt-name">$TBS</span>-&gt;MergeField(<span class="opt-value">'f1'</span>); <span class="opt-html">// merge field f1 witht the array $data</span><br>
    </div>
  </div>
  <br>
  Notes:<br>
  - To merge an assigned block or field, you just have to call the corresponding method using only the name of the assigned key. You can add the argument  Source = <span class="opt-value">'assigned'</span>, but this is optional because it is the default value. In other words, <span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'b'</span>) is equivalent to <span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'b'</span>, <span class="opt-value">'assigned'</span>).<br>
  - An assignment with <span class="opt-value">'auto'</span>=&gt;<span class="opt-value">'onload'</span> will be merged, of course, only if it is defined before calling the  LoadTemplate() method.<br>
  - You can pass some arguments by <a href="http://www.php.net/manual/en/language.references.php">reference</a> for you assignments. This is particularly  useful for PHP 4 which is passing object with a copy by default.<br>
  <br>
  <br>
  <div class="versioning">Versioning: property  Assigned is supported since TBS version 3.5. </div>
</div>
<div class="title-2"><a name="php_noerr" id="php_noerr"></a>property NoErr:</div>
<div class="norm"> Enables you to avoid all TinyButStrong error messages for next operations. Default value is <span class="opt-value">false</span>. The errors that were not displayed can however be returned with the special field <a href="#html_field_special" class="opt-name">[onshow..error_msg]</a>. Furthermore you can check the presence of error using property <span class="opt-value">ErrCount</span> which counts  TBS errors regardless of <span class="opt-value">Noerr</span>.<br>
  <br>
  Syntax: <span class="txt-code"><span class="opt-type">boolean</span> <span class="opt-name">$TBS</span>-&gt;NoErr<br>
  <br>
  </span>
  <div> Example: <span class="txt-code"><span class="opt-name">$TBS-&gt;</span>NoErr = <span class="opt-value">true</span>; <span class="opt-html">// no more error message is displayed</span></span></div>
  <br>
  Property <span class="opt-value">NoErr </span>is useful in two cases:<br>
  - For professional  sites put into production for whom no error message can be displayed. Take care because you will have no more indication about the good running of the merge. It is often more judicious to use parameter <a href="#html_field_prm_noerr" class="opt-name">noerr</a> which enables you to avoid messages concerning one particular TBS tag. <br>
  - For merges that do not accept TinyButStrong basic error messages. For example, an OpenOffice document will not open correctly if a TBS error occurs. Use <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;NoErr=<span class="opt-value">true</span></span> and the field <a href="#html_field_special" class="opt-name">[onshow..error_msg]</a> to display TBS errors in a viewable place of your OpenOffice document.<br>
  <br>
  <div class="versioning">Versioning:<br>
    - 
    Property  NoErr is supported since TBS version 3.0. <br>
    - Special field [onshow..error_msg] is supported since TBS version 3.5.0. </div>
</div>
<div class="title-2"><a name="php_render" id="php_render"></a>property Render:</div>
<div class="norm"> Indicates how the merging ends.<br>
  The value must be a combination of the following constants.<br>
  The default value is (<span class="opt-value">TBS_OUTPUT</span> + <span class="opt-value">TBS_EXIT</span>).<br>
  <br>
  Syntax: <span class="txt-code"><span class="opt-type">int</span> <span class="opt-name">$TBS</span>-&gt;Render<br>
  <br>
  </span>The Render property changes the behavior of the <a href="#php_show">Show()</a> method.<br>
  <br>
  <table border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="80" align="left" valign="top">Constant</td>
      <td align="left" valign="top">Description</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-value">TBS_NOTHING</td>
      <td align="left" valign="top">Indicates that none of the actions below are processed at the end of the merge.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-value">TBS_OUTPUT</td>
      <td align="left" valign="top">Indicates that the result of the merge must be displayed. TBS uses the Php command Echo.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-value">TBS_EXIT</td>
      <td align="left" valign="top">Indicates that we have to quit the script just after the end of the merge.</td>
    </tr>
  </table>
</div>
<div class="title-2"><a name="php_source" id="php_source"></a>property Source:</div>
<div class="norm">This property contains the source of the template currently merged. It is read/write. <br>
  When TinyButStrong processes a merging (when using the MergeBlock() method for example), the  Source property is modified immediately. <br>
  <br>
  Syntax: <span class="txt-code"><span class="opt-type">string</span> <span class="opt-name">$TBS</span>-&gt;Source</span><br>
  <br>
  Notes:<br>
  - The <a href="#php_loadtemplate">LoadTemplate()</a> method loads a file into the Source property and merges the [onload] tags automatically. Thus, Source may be different from the original template after LoadTemplate(). <br>
  - The <a href="#php_show">Show()</a> method merges [onshow] tags automatically before to display the result. <br>
  <br>
  In order to load a template stored into a Php variable, you can code: <br>
  <div class="decal txt-code"><span class="opt-name">$TBS</span>-&gt;Source = <span class="opt-name">$my_template</span>;<br>
    <span class="opt-name">$TBS</span>-&gt;LoadTemplate(<span class="opt-value">null</span>); <span class="opt-html">//  run plug-ins if any, and merges [onload] tags if any</span></div>
  <br>
  In order to store the result at the end of the merging, you can code:<br>
  <div class="decal txt-code"><span class="opt-name">$TBS</span>-&gt;Show(<span class="opt-value">TBS_NOTHING</span>); <span class="opt-html">// terminate the merging without leaving the script nor to display the result</span><br>
    <span class="opt-name">$result</span> = <span class="opt-name">$TBS</span>-&gt;Source;</div>
</div>
<div class="title-2"><a name="php_tplvars" id="php_tplvars"></a>property TplVars:</div>
<div class="norm">Contains the array of template variables corresponding to current template.<br>
  <br>
  Syntax: <span class="txt-code"><span class="opt-type">array</span> <span class="opt-name">$TBS</span>-&gt;TplVars<br>
  </span><br>
  You can define template variables using one or several <span class="opt-name">onload</span> <a href="#html_field_auto">automatic fields</a> with parameter <a href="#html_field_prm_tplvars" class="opt-name">tplvars</a>. 
  All  parameters that follow parameter <a href="#html_field_prm_tplvars" class="opt-name">tplvars</a> are added to the TplVars property when the LoadTemplate() method is called.<br>
  <div class="decal">Example:<br>
    &nbsp;&nbsp;[<span class="opt-name">onload</span>;<span class="opt-name">tplvars</span>;<span class="opt-name">template_version</span>=<span class="opt-value">'1.12.27'</span>;<span class="opt-name">template_date</span>=<span class="opt-value">'2004-10-26'</span>]<br>
    <span class="txt-small">This TBS tag will create two items equivalent to the PHP code:</span><br>
    <span class="txt-code"><span class="opt-name">&nbsp;$TBS</span>-&gt;TplVars[<span class="opt-value">'template_version'</span>] = <span class="opt-value">'1.12.27'</span>;</span><br>
    <span class="txt-code"><span class="opt-name">&nbsp;$TBS</span>-&gt;TplVars[<span class="opt-value">'template_date'</span>] = <span class="opt-value">'2004-10-26'</span>;</span> <br>
  </div>
  Remarks:<br>
  - Parameter <a href="#html_field_prm_tplvars" class="opt-name">tplvars</a> works only with <span class="opt-name">onload</span> <a href="#html_field_auto">automatic fields</a>.<br>
  - You can use parameter <a href="#html_field_prm_tplvars" class="opt-name">tplvars</a> several times in the same template. <br>
</div>
<div class="title-2" id="v202_oop_title"><a name="php_oop" id="php_oop"></a>Object Oriented Programming (OOP):</div>
<div class="norm" id="v202_oop">TinyButStrong integrate a technique to call methods or properties of objects that you've coded at the PHP side.<br>
  <br>
  <span class="title-1c">Calling methods of a class without  created object:</span> <br>
  <div class="decal">The following TBS features support the call to the methods of a class without created object.
    <div class="decal">
      <table width="100%"  border="0" cellspacing="0" cellpadding="2">
        <tr class="title-1b">
          <td width="180">Feature</td>
          <td>Example</td>
        </tr>
        <tr id="v205_ondata_ooo">
          <td>Parameter <a href="#html_block_prm_ondata">ondata</a></td>
          <td>[<span class="opt-name">blk1</span>.column1;<span class="opt-name">block</span>=<span class="opt-value">tr</span>;<span class="opt-name">ondata</span>=<span class="opt-value">MyClass.methA</span>]</td>
        </tr>
        <tr>
          <td>Parameter <a href="#html_field_prm_onformat">onformat</a></td>
          <td>[<span class="opt-name">blk1</span>.column2;<span class="opt-name">onformat</span>=<span class="opt-value">MyClass.methB</span>]</td>
        </tr>
        <tr>
          <td>Method <a href="#php_loadtemplate">LoadTemplate()</a></td>
          <td>$TBS-&gt;<span class="opt-name">LoadTemplate</span>(<span class="opt-value">'mytemplate.htm'</span>,<span class="opt-value">'=MyClass.methC'</span>);</td>
        </tr>
        <tr>
          <td>Method <a href="#php_mergefield">MergeField()</a></td>
          <td>$TBS-&gt;<span class="opt-name">MergeField</span>(<span class="opt-value">'myfield'</span>,<span class="opt-value">'MyClass.methD'</span>,<span class="opt-value">true</span>);</td>
        </tr>
      </table>
    </div>
    <span class="title-1b">Remark:</span> Methods call using this technique must respect the function syntax expected by the feature  (see the description of the corresponding feature).</div>
  <br>
  <span class="title-1c">Calling created objects:</span> <br>
  <br>
  <div class="decal">TBS has an ObjectRef property that is set to <span class="opt-type">false</span> by default, and that you can use to reference your objects already created. You can reference an object directly on the ObjectRef property, or you can reference some using PHP arrays.<br>
    Example: <br>
    <div class="decal"> <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;ObjectRef =&amp; <span class="opt-name">$MyObject1</span>;</span><br>
      &nbsp;&nbsp;&nbsp;You can use an array if you have several objects reference:<br>
      <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;ObjectRef[<span class="opt-value">'item1'</span>] =&amp; <span class="opt-name">$MyObject1</span>;</span><br>
      <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;ObjectRef[<span class="opt-value">'item2'</span>] =&amp; <span class="opt-name">$MyObject2</span>;</span><br>
      &nbsp;&nbsp;&nbsp;You can use as many levels as you wish:<br>
      <span class="txt-code"><span class="opt-name">$TBS</span>-&gt;ObjectRef[<span class="opt-value">'item3'</span>][<span class="opt-value">'a'</span>][<span class="opt-value">0</span>] =&amp; <span class="opt-name">$MyObject4</span>;</span></div>
    <span class="title-1b">Remarks:</span><br>
    * Think to use the assignment by reference using  "=&amp;" instead of "=", otherwise a copy of the object will be created.<br>
    * Since an object is referenced under ObjectRef, its sub objects will also be accessible by the TBS syntax. <br>
    <br>
    <span class="title-1b">&bull; Using ObjectRef in automatic fields:</span> <br>
    Use the  symbol '~' to call what is referenced under ObjectRef.<br>
    For example (valid for both <span class="opt-name">[onload]</span>, <span class="opt-name">[onshow]</span> and <span class="opt-name">[var</span>]):<br>
    <div class="decal">
      <table border="0" cellpadding="3" cellspacing="0">
        <tr class="title-1b">
          <td>The field </td>
          <td width="10">&nbsp;</td>
          <td>Will call </td>
        </tr>
        <tr>
          <td>[<span class="opt-name">onshow</span>.~<span class="opt-name">propA</span>]</td>
          <td class="txt-code">&nbsp;</td>
          <td class="txt-code"><span class="opt-name">$TBS</span>-&gt;ObjectRef-&gt;propA</td>
        </tr>
        <tr>
          <td>[<span class="opt-name">onshow</span>.~<span class="opt-name">propA</span>.<span class="opt-name">propB</span>]</td>
          <td class="txt-code">&nbsp;</td>
          <td class="txt-code"><span class="opt-name">$TBS</span>-&gt;ObjectRef-&gt;propA-&gt;propB</td>
        </tr>
        <tr>
          <td>[<span class="opt-name">onshow</span>.~<span class="opt-name">item2</span>.<span class="opt-name">propA</span>]</td>
          <td class="txt-code">&nbsp;</td>
          <td class="txt-code"><span class="opt-name">$TBS</span>-&gt;ObjectRef[<span class="opt-value">'item2'</span>]-&gt;propA</td>
        </tr>
        <tr>
          <td>[<span class="opt-name">onshow</span>.~<span class="opt-name">item2</span>.<span class="opt-name">methX</span>]</td>
          <td class="txt-code">&nbsp;</td>
          <td class="txt-code"><span class="opt-name">$TBS</span>-&gt;ObjectRef[<span class="opt-value">'item2'</span>]-&gt;methX()</td>
        </tr>
        <tr>
          <td>[<span class="opt-name">onshow</span>.~<span class="opt-name">item2</span>.<span class="opt-name">methY(a,b)</span>]</td>
          <td class="txt-code">&nbsp;</td>
          <td class="txt-code"><span class="opt-name">$TBS</span>-&gt;ObjectRef[<span class="opt-value">'item2'</span>]-&gt;methY(<span class="opt-value">'a'</span>,<span class="opt-value">'b'</span>)</td>
        </tr>
      </table>
    </div>
    <span class="title-1b">Remark: </span><br>
    TBS proceeds to  a coherence control, it will determine itself whether  your <a href="#html_field_auto">automatic field</a> definition is calling to ObjectRef via an array's item, an object's property or an object's method. Anyway, take care that your <a href="#html_field_auto">automatic field</a> must call a value at the end,  not an object.<br>
    <br>
    <span class="title-1b">&bull; Using ObjectRef in other TBS features:</span> <br>
    The following TBS features support the call to the methods of  objects referenced under ObjectRef. <br>
    <div class="decal">
      <table width="100%"  border="0" cellspacing="0" cellpadding="2">
        <tr class="title-1b">
          <td width="180">Feature</td>
          <td>Example</td>
        </tr>
        <tr id="v205_ondata_ooo">
          <td>Parameter <a href="#html_block_prm_ondata">ondata</a></td>
          <td>[<span class="opt-name">blk1</span>.column1;<span class="opt-name">block</span>=<span class="opt-value">tr</span>;<span class="opt-name">ondata</span>=<span class="opt-value">~item1.methA</span>]</td>
        </tr>
        <tr>
          <td>Parameter <a href="#html_field_prm_onformat">onformat</a></td>
          <td>[<span class="opt-name">blk1</span>.column2;<span class="opt-name">onformat</span>=<span class="opt-value">~item1.methB</span>]</td>
        </tr>
        <tr>
          <td>Method <a href="#php_loadtemplate">LoadTemplate()</a></td>
          <td>$TBS-&gt;<span class="opt-name">LoadTemplate</span>(<span class="opt-value">'mytemplate.htm'</span>,<span class="opt-value">'=~item1.methC'</span>);</td>
        </tr>
        <tr>
          <td>Method <a href="#php_mergefield">MergeField()</a></td>
          <td>$TBS-&gt;<span class="opt-name">MergeField</span>(<span class="opt-value">'myfield'</span>,<span class="opt-value">'~item1.methD'</span>,<span class="opt-value">true</span>);</td>
        </tr>
        <tr>
          <td>Method <a href="#plugins_db">MergeBlock()</a></td>
          <td>$TBS-&gt;<span class="opt-name">MergeBlock</span>(<span class="opt-value">'blk1'</span>,<span class="opt-value">'~mydb'</span>,<span class="opt-value">'SELECT * FROM t_table'</span>);</td>
        </tr>
      </table>
    </div>
    <span class="title-1b">Remark:</span> Methods call using this technique must respect the function syntax expected by the feature  (see the description of the corresponding feature).</div>
  <br>
</div>
<div class="title-3"><a name="html_side" id="html_side"></a>Template side:</div>
You design your template by placing <span class="tbsname">TBS tags </span> in the places where data items should appear.<br>
<br>
There are two types of TBS tags: <em>Fields</em> and <em>Blocks</em>.<br>
<br>
A <span class="title-1b">TBS Field</span> is a TBS tag which has to be replaced by a single data item. It is possible to specify a display format and also other parameters. The syntax for TBS Fields is described <a href="#html_field">below</a>.<br>
<br>
A <span class="title-1b">TBS Block</span> is an area which has to be repeated. It is defined using one or two TBS fields.<br>
Most often, it is the row of an HTML table. The syntax for TBS Blocks is described <a href="#html_block">below</a>.<br>
<br>
<br>
<div class="title-2"><a name="html_field" id="html_field"></a>TBS Fields:</div>
<div class="norm">A TBS field is a TBS tag which has to be replaced by a single data item.<br>
  A TBS fields must have a name to identify it (which does not have to be unique) and can have parameters to modify the displayed value.<br>
  <br>
  Syntax: <span class="opt-html"><strong>TEMPLATE ... </strong></span>[<span class="opt-name">FieldName</span>{;<span class="opt-name">param1</span>}{;<span class="opt-name">param2</span>}{;<span class="opt-name">param3</span>}{...}]<span class="opt-html"><strong> ... TEMPLATE</strong></span> <br>
  <br>
  <table border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="80" align="left" valign="top">Element</td>
      <td align="left" valign="top">Description</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">FieldName</td>
      <td align="left" valign="top">The name of the Field.<br>
        Warning: names that begin with <span class="opt-name">onload</span>, <span class="opt-name">onshow</span> and <span class="opt-name">var.</span>are reserved for <a href="#html_field_auto">automatic fields</a>.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">param1</td>
      <td align="left" valign="top"> Optional. One or more parameters from the list below and separated with ';'.<br>
        Some parameters can be set to a value using the equal sign '='.<br>
        <span class="decal">Example: <span class="opt-name">frm</span>=<span class="opt-value">0.00</span></span><br>
        If the value contains spaces, semicolons or quotes, then you can use single quotes as delimiters.<br>
        <span class="decal">Example: <span class="opt-name">frm</span>=<span class="opt-value">'0 000.00'</span></span><br>
        Use two single quotes to define a normal single quote  character in a delimited string. <br>
        <span class="decal">Example: <span class="opt-name">ifempty</span>=<span class="opt-value">'hello that''s me'</span></span><br>
        <br>
        A parameter can contain embedded TBS fields, but only under special circumstances:<br>
        - the embedded field is merged before the parent field,<br>
        - the embedded field if a <span class="opt-name">[var]</span> field placed into a parameter <a href="#html_field_prm_file" class="opt-name">file</a>, <a href="#html_field_prm_script" class="opt-name">script</a>, <a href="#html_field_prm_if" class="opt-name">if</a>, <span class="opt-name">then</span>, <span class="opt-name">else</span> or <a href="#html_block_prm_when" class="opt-name">when</a>.<br>
        In the other cases; the embedded  TBS field will not be processed and will be taken as is, like text.<br>
        Examples: <br>
        <div class="decal"><span class="opt-html">[x;htmlconv=[var.y]]</span> : [var.y] will not be merged and parameter   &quot;htmlconv&quot; will have an unvalid value.<br>
          <span class="opt-html">[x;if [var.y]=1]</span> : [var.y] will be correctly merged and the &quot;if&quot; condition will be correctly evaluated.</div></td>
    </tr>
  </table>
  <span class="opt-name"><a name="html_field_prm" id="html_field_prm"></a></span><br>
  <div class="title-1c">Field's parameters:</div>
  <br>
  <table border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="80" align="left" valign="top">Parameter</td>
      <td align="left" valign="top">Description</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_field_prm_htmlconv" id="html_field_prm_htmlconv"></a>htmlconv</span>=<span class="opt-name"><span class="opt-value">val</span></span></td>
      <td align="left" valign="top" class="border-sep">Ennables you to modify the special character conversion for this TBS field only. Note that the special character conversion  used by default for all TBS fields is the one defined by <a href="#php_loadtemplate">LoadTemplate()</a>. It is often corresponding to an Xml/Html charset but not necessary.<br>
        The value <span class="opt-name"><span class="opt-value">val</span></span> can be one of the following keywords:
        <div class="decal">
          <table border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td width="50" valign="top"><span class="opt-name"><span class="opt-value">yes</span></span>:</td>
              <td>(default value) Performe  the default special character conversion, including new lines.</td>
            </tr>
            <tr>
              <td valign="top"><span class="opt-name"><span class="opt-value">no</span></span>:</td>
              <td>No special character conversion. Useful to modify Xml/Html source.</td>
            </tr>
            <tr>
              <td valign="top"><span class="opt-name"><span class="opt-value">nobr</span></span>:</td>
              <td>Let  the default special character conversion, except new lines (useful for &lt;pre&gt; tags for example).</td>
            </tr>
            <tr>
              <td valign="top"><span class="opt-name"><span class="opt-value">wsp</span></span>:</td>
              <td>Preserve white spaces (useful for spaces at the beginning of lines).</td>
            </tr>
            <tr>
              <td valign="top"><span class="opt-name"><span class="opt-value">esc</span></span>:</td>
              <td>No special character conversion and double the single quote characters (').</td>
            </tr>
            <tr id="v202_js">
              <td valign="top"><span class="opt-name"><span class="opt-value">js</span></span>:</td>
              <td>Convert the data item to a string that can be inserted between JavaScript text delimiters. </td>
            </tr>
            <tr id="v202_js2">
              <td valign="top"><span class="opt-name"><span class="opt-value">url</span></span>:</td>
              <td>Convert the data item to a string that can be inserted inside an URL. <span class="versioning">(Keyword url is supported since TBS version 3.5.2)</span></td>
            </tr>
            <tr>
              <td valign="top"><span class="opt-name"><span class="opt-value">look</span></span>:</td>
              <td>Deprecated. Performe the default special character conversion  only if no Xml/Html entities are found inside the data item.</td>
            </tr>
          </table>
        </div>
        You can specify several values using seperator <span class="opt-value">'+'</span>. Example : <span class="opt-name">htmlconv</span>=<span class="opt-value">yes+js</span></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_field_prm_dot" id="html_field_prm_dot"></a>. </span>(dot)</td>
      <td align="left" valign="top" class="border-sep">If the data item is empty, then an unbreakable space is displayed. Useful for cells in tables.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_field_prm_ifempty" id="html_field_prm_ifempty"></a>ifempty</span>=<span class="opt-name"><span class="opt-value">val</span></span></td>
      <td align="left" valign="top" class="border-sep">If the data item is empty, then it is replaced with the specified value.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_field_prm_att" id="html_field_prm_ifempty2"></a>att</span>=<span class="opt-name"><span class="opt-value">path</span></span></td>
      <td align="left" valign="top" class="border-sep">Move the current field into an attribute of an XML/HTML  tag before it is merged. This parameter is very useful when it is too difficult for the template designer  to place a TBS field into an attribute.<br>
        The value <span class="opt-value">path</span> must indicate the place of the attribute relatively to the current field.<br>
        If the attribute doesn't exist in the specified tag, then it is created.<br>
        If the attribute already exists in the specified tag and it has already a value, then the field replaces all the current value.<br>
        You can chose to place the field as an added value using parameter <span class="opt-name">attadd</span>.<br>
        You can delete the attribute in case of empty value using parameter <span class="opt-name">magnet</span>=<span class="opt-value">#</span>.<br>
        <br>
        Syntax for value <span class="opt-value">path</span>:      [<span class="opt-value">+</span>][<span class="opt-value">tag1+tag2+tag3+...#</span>]<span class="opt-value">attribute</span><br>
        By default the attribute is searched before the current field. But if '<span class="opt-value">+</span>' is the first character of the path, then it is searched after. If no tag list is specified, then the attribute is looked at in the first tag met in the search direction. If a tag list is used, <span class="opt-value">tag1</span> is search first, then <span class="opt-value">tag2</span>, ... regardless of the direction of the search (before/after). You can put a tag name between one or several bracket levels in order to specify that the searched tag must embed the current field.<br>
        <br>
        Examples:<br>
        <div class="decal">[<span class="opt-name">onshow.x</span>;<span class="opt-name">att</span>=<span class="opt-value">class</span>] moves into attribute '<span class="opt-value">class</span>' of the first tag placed before.<br>
          [<span class="opt-name">onshow.x</span>;<span class="opt-name">att</span>=<span class="opt-value">div#class</span>] moves into attribute '<span class="opt-value">class</span>' of the first <span class="opt-html">&lt;div&gt;</span> placed before.<br>
          [<span class="opt-name">onshow.x</span>;<span class="opt-name">att</span>=<span class="opt-value">+div#class</span>] moves into attribute '<span class="opt-value">class</span>' of the first <span class="opt-html">&lt;div&gt;</span> placed after.<br>
          [<span class="opt-name">onshow.x</span>;<span class="opt-name">att</span>=<span class="opt-value">((div))#class</span>] moves into attribute '<span class="opt-value">class</span>' of the second embedding <span class="opt-html">&lt;div&gt;</span> placed before.<br>
          [<span class="opt-name">onshow.x</span>;<span class="opt-name">att</span>=<span class="opt-value">table+div#class</span>] moves into attribute '<span class="opt-value">class</span>' of the first <span class="opt-html">&lt;div&gt;</span> after the first <span class="opt-html">&lt;table&gt;</span> placed before.</div>
        <br>
        Notes:<br>
        - Method  MergeBlock() cannot   move a TBS field  over another TBS field placed after it. This makes a TBS error to occur.<br>
        - When the attribute has no value before the field is moved, then TBS chooses what string delimiter  to use regarding other attributes (XML/HTML accepts both (&quot;) and (')). You can force the delimiter  you need using property $TBS-&gt;AttDelim.<br>
        <br>
        <span class="versioning">Versioning: Parameter att is supported since TBS version 3.5.0</span></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_field_prm_attadd" id="html_field_prm_ifempty3"></a>attadd</span></td>
      <td align="left" valign="top" class="border-sep">To be used with parameter<span class="opt-name"> att</span>. Indicate that the field is added into the attribute's value, instead of beeing replacing the attribute's value.<br>
        <span class="versioning">Versioning: Parameter attadd is supported since TBS version 3.5.0</span></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_field_prm_magnet" id="html_field_prm_magnet"></a><span class="opt-name">magnet</span>=<span class="opt-value">tag</span><br>
        <span class="txt-small">or</span><br>
        <span class="opt-name">magnet</span>=<span class="opt-value">expr</span></td>
      <td align="left" valign="top" class="border-sep">Assign a magnet XML/HTML zone to the TBS field. A magnet tag is kept as is when the field has a value, and is deleted when the field is null or empty string. Parameter <span class="opt-name">magnet</span> supports the same syntax as parameter <a href="#html_block_prm_block" class="opt-name">block</a>, i.e. that <span class="opt-value">expr</span> must be an XML/HTML tag or a TBS <a href="#html_block_prm_extblk">extended block</a> expression.<br>
        <div class="decal">Example:<br>
          <span class="opt-html">(&lt;a href=&quot;[onshow.link;magnet=a]&quot;&gt;click here&lt;/a&gt;)</span><br>
          Result for <span class="txt-code">$link='www.tbs.com'</span>: <span class="opt-html">(&lt;a href=&quot;www.tbs.com&quot;&gt;click here&lt;/a&gt;)</span><br>
          Result for <span class="txt-code">$link=''</span>: <span class="opt-html">()</span></div>
        By default, the magnet XML/HTML zone should be delimited by a pair of opening-closing tags (like <span class="opt-html">&lt;a&gt;&lt;/a&gt;</span>) which first tag is placed before the TBS fields. But this can be changed using parameter <span class="opt-name">mtype</span> (see below).<br>
        <span class="versioning">Since TBS version 3.3.0</span>, <a href="#html_field_prm_ope">parameter</a> <a href="#html_field_prm_ope" class="opt-name">ope</a> has keywords (<span class="opt-value">nif</span>, <span class="opt-value">minv</span>, <span class="opt-value">mok</span> and <span class="opt-value">mko</span>) that improve parameter <span class="opt-name">magnet</span>. <br>
        Remark: the parameters <span class="opt-name">if then else</span> are processed before parameter <span class="opt-name">magnet.</span></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_field_prm_mtype" id="html_field_prm_mtype"></a><span class="opt-name">mtype</span>=<span class="opt-value">val</span></td>
      <td align="left" valign="top" class="border-sep">To be used with parameter<span class="opt-name"> magnet</span>. Define the magnet type.<br>
        <br>
        <div class="decal">
          <table  border="0" cellpadding="0" cellspacing="0">
            <tr align="left" valign="top">
              <td class="title-1b">Value</td>
              <td class="title-1b">Magnet behavior when field is null or empty string </td>
            </tr>
            <tr align="left" valign="top">
              <td width="60" class="opt-value">m*m </td>
              <td>That's the default value. Delete the pair of tags that surrounds the TBS field. Everything that is between them is deleted also. The field can be put inside one of the tags.<br>
                <div class="decal">Example:<br>
                  <span class="opt-html">(&lt;a href=&quot;[onshow.link;magnet=a]&quot;&gt;click here&lt;/a&gt;)</span><br>
                  Result for <span class="txt-code">$link='www.tbs.com'</span>: <span class="opt-html">(&lt;a href=&quot;www.tbs.com&quot;&gt;click here&lt;/a&gt;)</span><br>
                  Result for <span class="txt-code">$link=''</span>: <span class="opt-html">()</span></div></td>
            </tr>
            <tr align="left" valign="top">
              <td class="opt-value">m+m</td>
              <td>Delete the pair of tags that surrounds the TBS field, but keeping everything else that is between the tags.
                <div class="decal">Example:<br>
                  <span class="opt-html">(&lt;a href=&quot;mailto:[blk.email;magnet=a;mtype=m+m]&quot;&gt;[blk.name]&lt;/a&gt;)</span><br>
                  Result for <span class="txt-code">$email='hide@address.com'</span>: <span class="opt-html">(&lt;a href=&quot;mailto:hide@address.com&quot;&gt;MyName&lt;/a&gt;)</span><br>
                  Result for <span class="txt-code">$email=''</span>: <span class="opt-html">(MyName)</span></div></td>
            </tr>
            <tr align="left" valign="top">
              <td class="opt-value">m*</td>
              <td>Delete the single tag that is before the field, and everything that is between the tag and the field.
                <div class="decal">Example 1: <span class="opt-html">&lt;img href=&quot;[onshow.link;magnet=img;mtype=m*]&quot;&gt;</span> <br>
                  Example 2:<span class="opt-html"> &lt;br&gt; [onshow.address;magnet=br]</span></div></td>
            </tr>
            <tr align="left" valign="top">
              <td class="opt-value">*m</td>
              <td>Delete the single tag that is after the field, and everything that is between the tag and the field.
                <div class="decal">Example:<span class="opt-html"> [onshow.address;magnet=br;mtype=*m]&lt;br&gt;</span></div></td>
            </tr>
          </table>
        </div>
        <div class="decal"></div></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_field_prm_comm"></a><span class="opt-name">comm</span></td>
      <td align="left" valign="top" class="border-sep">Widen the bounds of the TBS Field up to the bounds of the commentary Html tags which surround it, or up to another specified couple of XML/HTML tags.<br>
        Example: <br>
        <div class="decal"><span class="opt-html">xxx &lt;!-- </span>[<span class="opt-name">myfield</span>;<span class="opt-name">comm</span>]<span class="opt-html"> here some comments --&gt; yyy</span></div>
        or<br>
        <div class="decal"><span class="opt-html">xxx &lt;div&gt; </span>[<span class="opt-name">myfield</span>;<span class="opt-name">comm</span>=<span class="opt-value">div</span>] <span class="opt-html">here some comments &lt;/div&gt; yyy</span></div>
        are strictly identical to:<br>
        <div class="decal"><span class="opt-html">xxx</span> [<span class="opt-name">myfield</span>]<span class="opt-html"> yyy </span></div>
        <span class="opt-html"></span> This parameter is particularly useful for the template designing when you are using a Visual HTML Editor (such as Dreamweaver or FrontPage).<br>
        <div class="versioning">Versioning: Support for other XML/HTML tags was added in TBS 3.0.</div></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_field_prm_noerr"></a><span class="opt-name">noerr</span></td>
      <td align="left" valign="top" class="border-sep">Avoid some of the TBS Error messages. When a message can be cancelled, it is mentioned in the message.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_field_prm_file"></a>file</span>=<span class="opt-name"><span class="opt-value">filename</span></span></td>
      <td align="left" valign="top" class="border-sep">Replace the field with the contents of the file.<br>
        <span class="opt-name"><span class="opt-value">Filename</span></span> can be a string or an expression.<br>
        You can use the keyword <span class="opt-value">[val]</span> inside the expression to insert the current data item.<br>
        You can use <span class="opt-value">[var]</span> fields inside the expression.<br>
        Examples: <br>
        <div class="decal">[<span class="opt-name">onload</span>;<span class="opt-name">file</span>=<span class="opt-value">header.html</span>]<br>
          [<span class="opt-name">onload</span>;<span class="opt-name">file</span>=[<span class="opt-name">var</span>.<span class="opt-name">filename</span>]] </div>
        If the file is not found, then it will also be searched in the folder of the last loaded template  (<span class="versioning">since TBS version 3.2.0</span>).<br>
        If <span class="opt-value">filename</span> is an empty string, then no error message is displayed, it is like parameter <span class="opt-name">file</span> is ignored. This can be used to manage conditional insertion. <br>
        Example: <br>
        <div class="decal"> [<span class="opt-name">onload</span>;<span class="opt-name">file</span>=[<span class="opt-name">var</span>.<span class="opt-name">insert</span>;if [<span class="opt-name">val</span>]=1;<span class="opt-name">then</span> <span class="opt-value">'header.html'</span>;<span class="opt-name">else</span> <span class="opt-value">''</span>]]</div>
        You will found more details about this paremater in the chapter <a href="#html_subtemplate">Subtemplates</a>.<br>
        <span class="txt-small">See also: <a href="#html_field_prm_getbody" class="opt-name">getbody</a> <a href="#html_field_prm_script" class="opt-name">script</a></span></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_field_prm_getbody" id="html_field_prm_getbody"></a><span class="opt-name">getbody</span>=<span class="opt-value">taglist</span></td>
      <td align="left" valign="top" class="border-sep">To be used with parameter <span class="opt-name">file</span> or <span class="opt-name">script</span>. Indicates that not all the file contents is loaded but only some XML/HTML parts of it defined with the  tag list. The tags of the list must be separated with plus (+), and placed between parentheses if you want the tags themselves to be retrieved with their content. If the file has several XML/HTML part of a tag, all those parts will be automatically concatenated.    	  If parameter <span class="opt-name">getbody</span> is used without value, then  the &lt;body&gt; tag is taken by default.<br>
        Example:
        <div class="decal">[onload;<span class="opt-name">file</span>=<span class="opt-value">header.htm</span>;<span class="opt-name">getbody</span>=<span class="opt-value">(script)+(style)+body</span>]</div>
        <br>
        <div class="versioning">Versioning: parameter getbody is supported since TBS version 3.0. 
          In previous versions, it was automatically processed when using parameter file. Now it becomes explicit. <br>
          The tag list is supported since TBS version 3.5.0. Before this version, the value of getbody can be only one tag without parentheses. </div></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_field_prm_rename" id="html_field_prm_subtpl2"></a><span class="opt-name">rename</span> <span class="opt-value">old</span><span class="opt-name">=</span><span class="opt-value">new</span></td>
      <td align="left" valign="top" class="border-sep">To be used with parameter <span class="opt-name">file</span> or <span class="opt-name">script</span>. Renames  TBS blocks and fields in the subtemplate before it is inserted. You can define several block to rename by separate them with coma. If a new name is an empty string  then the old block is deleted by merging it with an empty array.<br>
        This parameter is useful when you want to use the same subtemplate several times in the main template. <br>
        Example:
        <div class="decal">Address 1: [onload;<span class="opt-name">file</span>=<span class="opt-value">address.htm</span>]<br>
          Address 2: [onload;<span class="opt-name">file</span>=<span class="opt-value">address.htm</span>;<span class="opt-name">rename </span><span class="opt-value">town1=town2,zip1=zip2,email=</span>]</div>
        <div class="versioning">Versioning: parameter rename is supported since TBS version 3.5.1.</div>
        See chapter '<a href="#html_subtemplate">Subtemplates</a>' for more details about subtemplates.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_field_prm_script"></a>script</span>=<span class="opt-name"><span class="opt-value">filename</span></span></td>
      <td align="left" valign="top" class="border-sep">Execute the Php script just before replacing the TBS field.<br>
        <span class="opt-name"><span class="opt-value">Filename</span></span> can be a string or an expression.<br>
        You can use the keyword <span class="opt-value">[val]</span> inside the expression to insert the current data item.<br>
        You can use <span class="opt-value">[var]</span> fields inside the expression.<br>
        <table width="100%" border="0" cellpadding="2" cellspacing="0" >
          <tr>
            <td width="10" valign="top">*</td>
            <td>Take care that in your script <span class="title-1c"> variables will be obsiously local instead of global</span>. This is because the script is called from a TBS method. In order to define or reach global variables in your script, you have to use the Php instruction <a href="http://fr.php.net/global" target="_blank">global</a> or the array <span class="txt-code">$GLOBAL</span>.</td>
          </tr>
          <tr id="v202_locvar">
            <td valign="top">*</td>
            <td >TBS gives to you predefined local variables that can be used in your script:<br>
              - <span class="opt-name">$CurrVal</span> refers to the current value of the field. It can be modified. <br>
              - <span class="opt-name">$CurrPrm</span> refers to the array of field's parameters.<br>
              - <span class="opt-name">$this</span> refers to the current TBS instance. (See parameter <span class="opt-name">subtpl</span> for good usage) </td>
          </tr>
          <tr>
            <td valign="top">*</td>
            <td>Parameter <span class="opt-name">script</span> is sensible to the <span class="opt-name">if</span> parameter. If there is a parameter <span class="opt-name">if</span> in the field, then the script is executed only if the condition is verified.</td>
          </tr>
        </table>
        <span id="v202_subtpl_script">See chapter '<a href="#html_subtemplate">Subtemplates</a>' for more details about how to use this parameter in subtemplate mode.</span></td>
    </tr>
    <tr id="v202_subtpl">
      <td align="left" valign="top" class="border-sep"><a name="html_field_prm_subtpl" id="html_field_prm_subtpl"></a><span class="opt-name">subtpl</span></td>
      <td align="left" valign="top" class="border-sep">To be used with the parameter<span class="opt-name"> script</span> or parameter <span class="opt-name">onformat</span>.<br>
        Activate the subtemplate mode during the script or function execution.<br>
        See chapter '<a href="#html_subtemplate">Subtemplates</a>' for more details.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_field_prm_if" id="html_field_prm_if"></a>if</span> <span class="opt-value">expr1</span><span class="opt-name">=</span><span class="opt-value">expr2</span></td>
      <td align="left" valign="top" class="border-sep">Display the data item only if the condition is verified, otherwise display nothing unless parameter <span class="opt-name">then</span> or <span class="opt-name">else</span> are used.<br>
        Supported operators are: <br>
        <div class="decal">
          <table  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="80"><span class="opt-name">=</span> or <span class="opt-name">==</span></td>
              <td>equal</td>
            </tr>
            <tr>
              <td class="opt-name">!=</td>
              <td>not equal </td>
            </tr>
            <tr>
              <td class="opt-name">+-</td>
              <td>greater than </td>
            </tr>
            <tr>
              <td class="opt-name">+=-</td>
              <td>greater than or equal to </td>
            </tr>
            <tr>
              <td class="opt-name">-+</td>
              <td>less than </td>
            </tr>
            <tr>
              <td class="opt-name">-=+</td>
              <td>less than or equal to </td>
            </tr>
            <tr>
              <td class="opt-name">~=</td>
              <td>match the <a href="http://www.php.net/manual/en/function.preg-match.php">regular expression</a> <span class="versioning">(since TBS version 3.0)</span></td>
            </tr>
          </table>
        </div>
        Both <span class="opt-value">expr1</span> and <span class="opt-value">expr2</span> must be string or numerical expressions.<br>
        You can use the keyword <span class="opt-value">[val]</span> inside the expression to insert the current data item.<br>
        You can use <span class="opt-value">[var]</span> fields inside the expression.<br>
        The expressions may contain other TBS fields, but you have to make sure that they are merged before the containing field.<br>
        <span class="versioning">Since TBS version 3.0,</span> it is also possible to define several couples of <span class="opt-name">if</span>/<span class="opt-name">then</span> in the same field.<br>
        See parameters <span class="opt-name">then</span> and <span class="opt-name">else</span> for some examples.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_field_prm_then" id="html_field_prm_then"></a>then</span><span class="opt-name"><span class="opt-value"> val1</span></span></td>
      <td align="left" valign="top" class="border-sep">If the parameter <span class="opt-name">if</span> is defined and its condition is verified, then the data item is replaced with <span class="opt-value">val1</span>.<br>
        <span class="versioning">Since TBS version 3.0,</span> it is also possible to define several couples of <span class="opt-name">if</span>/<span class="opt-name">then</span> in the same field.<br>
        Examples:<br>
        <div class="decal"> [<span class="opt-name">onshow.image</span>;<span class="opt-name">if</span> <span class="opt-value">[val]</span>=<span class="opt-value">''</span>;<span class="opt-name">then</span> <span class="opt-value">'image0.gif'</span>]<br>
          [<span class="opt-name">onshow</span>.<span class="opt-name">x</span>;<span class="opt-name">if</span> <span class="opt-value">[val]=1</span>;<span class="opt-name">then</span> <span class="opt-value">'one'</span>;<span class="opt-name">if</span> <span class="opt-value">[val]=2</span>;<span class="opt-name">then</span> <span class="opt-value">'two'</span>;<span class="opt-name">else</span> <span class="opt-value">'more'</span>] </div>
        You can use the keyword <span class="opt-value">[val]</span> inside the expression to insert the current data item.<br>
        You can use <span class="opt-value">[var]</span> fields inside the expression.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_field_prm_else" id="html_field_prm_else"></a><span class="opt-name">else</span> <span class="opt-value">val2</span></td>
      <td align="left" valign="top" class="border-sep">If the parameter <span class="opt-name">if</span> is defined and its condition is not verified, then the data item is replaced with <span class="opt-value">val2</span>.<br>
        Example:
        <div class="decal"> [<span class="opt-name">onshow.error_id</span>;<span class="opt-name">if</span> <span class="opt-value">[val]</span>=<span class="opt-value">0</span>;<span class="opt-name">then</span> <span class="opt-value">'no error'</span>;<span class="opt-name">else</span> <span class="opt-value">'error found'</span>] </div>
        You can use the keyword <span class="opt-value">[val]</span> inside the expression to insert the current data item.<br>
        You can use <span class="opt-value">[var]</span> fields inside the expression.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_field_prm_onformat" id="html_field_prm_onformat"></a><span class="opt-name">onformat</span>=<span class="opt-value">fct_name</span></td>
      <td align="left" valign="top" class="border-sep"> Indicates the name of a user Php function that will be executed at the time when the value is formated for the merge. This allows typically to modify the text to display.<br>
        Since TBS version 3.0, it's also possible to indicate a method of a class (see <a href="#php_oop">OOP</a>).<br>
        The function <span class="opt-value">fct_name</span> must have the following syntax:<br>
        <span class="txt-code">&nbsp;&nbsp;function <span class="opt-value">fct_name</span>(<span class="opt-name">$FieldName</span>,&amp;<span class="opt-name">$CurrVal</span>,{&amp;<span class="opt-name">$CurrPrm</span>,{&amp;<span class="opt-name">$TBS</span>}}) { ... }<br>
        </span> <span class="opt-name"> </span>
        <table border="0" cellspacing="0" cellpadding="2">
          <tr class="title-1b">
            <td width="10" valign="top">&nbsp;</td>
            <td width="80" valign="top">Argument</td>
            <td>Description</td>
          </tr>
          <tr>
            <td valign="top">&nbsp;</td>
            <td valign="top"><span class="opt-name">$</span><span class="opt-name">FieldName</span></td>
            <td>Gives the name of the current field (read only).</td>
          </tr>
          <tr>
            <td valign="top" class="opt-name">&nbsp;</td>
            <td valign="top" class="opt-name">$CurrVal</td>
            <td>Gives the value of the current field (read/write<span class="txt-small"> <em>; don't forget the &amp; character in the statement</em></span>).</td>
          </tr>
          <tr id="v202_onformat_currprm">
            <td valign="top" class="opt-name">&nbsp;</td>
            <td valign="top" class="opt-name">$CurrPrm</td>
            <td>Optional. Gives  the PHP array containing the parameters for the current field (<span class="txt-small"><em>Don't forget the &amp; character in the statement</em></span>).</td>
          </tr>
          <tr id="v202_onformat_tbs">
            <td valign="top" class="opt-name">&nbsp;</td>
            <td valign="top" class="opt-name">$TBS</td>
            <td>Optional. Gives  the current TBS instance. (<span class="txt-small"><em>Don't forget the &amp; character in the statement</em></span>).<br>
              Use this argument with lot of care. It is used sometimes for the subtemplate mode. </td>
          </tr>
        </table>
        <span id="v202_subtpl_onformat">See chapter '<a href="#html_subtemplate">Subtemplates</a>' for more details about how to use this arguments in subtemplate mode.</span></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_field_prm_protect" id="html_field_prm_protect"></a>protect</span>=<span class="opt-name"><span class="opt-value">val</span></span></td>
      <td align="left" valign="top" class="border-sep">Enables you to protect or unprotect the data item to be merged by replacing the characters '<span class="opt-html">[</span>' with their corresponding XML/HTML code '<span class="opt-html">&amp;#91;</span>'. The value <span class="opt-name"><span class="opt-value">val</span></span> can be one of the following keywords:<br>
        &nbsp; <span class="opt-name"><span class="opt-value">yes</span></span>: (default value) data item is protected.<br>
        &nbsp; <span class="opt-name"><span class="opt-value">no</span></span>: data item is not protected.<br>
        By default, all data merged with a template is protected except if it's a file inclusion. It is strongly recommended to protect data when it comes from free enter like on a forum for example.<br>
        Nevertheless, it is possible to disable the protection by default if you set property <span class="opt-name">$TBS</span>-&gt;<span class="opt-value">Protect</span> to <span class="opt-value">false</span>.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><span class="opt-value"><a name="html_field_prm_ope" id="html_field_prm_ope"></a></span>ope</span>=<span class="opt-name"><span class="opt-value">action</span></span></td>
      <td align="left" valign="top" class="border-sep">Makes one or several operations on the value to merge. You can define several operations to be processed in order by separating them with coma (,).<br>
        Example: <br>
        <div class="decal">[<span class="opt-name">onshow</span>.<span class="opt-name">x</span>;<span class="opt-name">ope</span>=<span class="opt-value">add:-1</span>,<span class="opt-value">mod:10</span>]</div>
        Supported operations are:
        <div class="decal">
          <table  border="0" cellspacing="0" cellpadding="3">
            <tr>
              <td width="50" valign="top" class="opt-value">max:n</td>
              <td>Limit the text string to a maximum of <span class="opt-value">n</span> characters. If the string is cut, then its end is replaced with dot lines '...'.<br>
                <span class="decal">Example:							[onshow.caption;<span class="opt-name">ope</span>=<span class="opt-value">max:10</span>]</span><br>
                - Add parameter <span class="opt-name">maxhtml</span> to indicate that the value before merging can contain Html characters. <br>
                - Add parameter <span class="opt-name">maxutf8</span> to indicate that the value before merging can contain UTF8 characters. <span class="versioning">Versionning: maxutf8 is supported since TBS version 3.5.2.</span><br>
                - Add parameter <span class="opt-name">maxend</span> to change the cutting symbol.<br>
                <span class="decal">Example:
                [onshow.caption;<span class="opt-name">ope</span>=<span class="opt-value">max:10</span>;<span class="opt-name">maxhtml</span>;<span class="opt-name">maxend</span>=<span class="opt-value">'+'</span>]</span></td>
            </tr>
            <tr>
              <td valign="top" class="opt-value">mod:n</td>
              <td>Apply the modulo <span class="opt-value">n</span> to the value to merge. Example:							[onshow.numlig;<span class="opt-name">ope</span>=<span class="opt-value">mod:7</span>]</td>
            </tr>
            <tr>
              <td valign="top" class="opt-value">add:n</td>
              <td>Add the numeric <span class="opt-value">n</span> to the value to merge. 							Example:							[onshow.number;<span class="opt-name">ope</span>=<span class="opt-value">add:-1</span>]</td>
            </tr>
            <tr>
              <td valign="top" class="opt-value">mul:n</td>
              <td>Mutlyplies the value to merge by the numeric <span class="opt-value">n</span>. </td>
            </tr>
            <tr>
              <td valign="top" class="opt-value">div:n</td>
              <td>Divises the value to merge by the numeric <span class="opt-value">n</span>. </td>
            </tr>
            <tr>
              <td valign="top"><span class="opt-value">list</span></td>
              <td>If the value before merging is a Php Array, then its items are displayed separated with a coma (,).<br>
                <span class="decal">Example:							[onshow.myarray;<span class="opt-name">ope</span>=<span class="opt-value">list</span>]</span><br>
                Add parameter valsep in order to change the item separator.<br>
                <span class="decal">Example:							[onshow.myarray;<span class="opt-name">ope</span>=<span class="opt-value">list</span>;<span class="opt-name">valsep</span>=<span class="opt-value">'+'</span>]</span></td>
            </tr>
            <tr>
              <td valign="top" class="opt-value">mok:x</td>
              <td><em>(means &quot;magnet ok&quot;)</em> To be used with parameter <a href="#html_field_prm_magnet" class="opt-name">magnet</a>. The TBS fields is never displayed, but the magnet tag is kept when the value of the field is equal to <span class="opt-value">'x'</span>. The magnet tag is deleted in other cases. You can define several values to keep the magnet tag by defining several <span class="opt-value">mok</span>. Example: [onshow.x;magnet=div;<span class="opt-name">ope</span>=<span class="opt-value">mok:1</span>,<span class="opt-value">mok:2</span>] <span class="versioning">(mok is supported since TBS version 3.5.2)</span></td>
            </tr>
            <tr>
              <td valign="top" class="opt-value">mko:x</td>
              <td><em>(means &quot;magnet ko&quot;)</em> To be used with parameter <a href="#html_field_prm_magnet" class="opt-name">magnet</a>. The TBS fields is never displayed, but the magnet tag is deleted when the value of the field is equal to <span class="opt-value">'x'</span>. The magnet tag is kept in other cases. You can define several values to delete the magnet tag by defining several <span class="opt-value">mko</span>. Example: [onshow.x;magnet=div;<span class="opt-name">ope</span>=<span class="opt-value">mko:1</span>,<span class="opt-value">mko:2</span>] <span class="versioning">(mok is supported since TBS version 3.5.2)</span></td>
            </tr>
            <tr>
              <td valign="top" class="opt-value">nif:x</td>
              <td><em>(means &quot;null if&quot;)</em> If the value is equal to <span class="opt-value">'x'</span> then it is replaced with <span class="opt-value">''</span> <span class="txt-small">(empty string)</span>. This operation is designed to make parameter <a href="#html_field_prm_magnet" class="opt-name">magnet</a> to work with other values than <span class="opt-value">''</span>. <span class="versioning">(supported since TBS version 3.3.0)</span></td>
            </tr>
            <tr>
              <td valign="top" class="opt-value">minv</td>
              <td><em>(means &quot;magnet invisible&quot;)</em> Replace the value with <span class="opt-value">''</span> <span class="txt-small">(empty string)</span> but parameter <a href="#html_field_prm_magnet" class="opt-name">magnet</a> will consider the old value. This operation is designed to make totaly invisible a TBS field which do magnet stuffs. <span class="versioning">(supported since TBS version 3.3.0)</span></td>
            </tr>
          </table>
        </div>
        <div class="versioning">Versioning:<br>
          - 
          Parameter ope   is supported since TBS version 3.0. 
          It replaces parameter max which doesn't exist since this version.<br>
          - Multiple operations and 'mul&quot; and &quot;div&quot; are supported since TBS version 3.2.0 </div></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_field_prm_frm" id="html_field_prm_frm"></a>frm</span>=<span class="opt-value">format</span></td>
      <td align="left" valign="top" class="border-sep">Specify a format to display for a data item which type is date/time or numeric. It is possible to use a conditional format which changes depending on the sign of the value. The format  is considered as numeric type as soon as it contains the character <span class="opt-value">0</span>, otherwise it is considered as date/time type. <br>
        <br>
        <div class="title-1c">Date-time format:</div>
        <br>
        It is a VisualBasic like format. The following keywords are recognized:<br>
        <table  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="150" valign="top"><span class="opt-value">d</span>, <span class="opt-value">dd</span>, <span class="opt-value">ddd</span>, <span class="opt-value">dddd</span>:</td>
            <td>number of the day, number of the day in two digits, short name of the day, full name of the day. Add keyword <span class="opt-value">(locale)</span> to display locale names.</td>
          </tr>
          <tr>
            <td valign="top" class="opt-value">xx</td>
            <td>displays <span class="opt-html">st</span>, <span class="opt-html">nd</span>, <span class="opt-html">rd</span> or <span class="opt-html">th</span> depending to the number of the day.</td>
          </tr>
          <tr>
            <td valign="top" class="opt-value">w</td>
            <td>number of the day in the week (from 0 to 6) </td>
          </tr>
          <tr>
            <td valign="top"><span class="opt-value">m</span>, <span class="opt-value">mm</span>, <span class="opt-value">mmm</span>, <span class="opt-value">mmmm</span>: </td>
            <td>number of the month, number of the month in two digits, short name of the month, full name of the month. Add keyword <span class="opt-value">(locale)</span> to display locale names.</td>
          </tr>
          <tr>
            <td valign="top"><span class="opt-value">yy</span>, <span class="opt-value">yyyy</span>:</td>
            <td>year in two digits, full year. </td>
          </tr>
          <tr>
            <td valign="top"><span class="opt-value">hh</span>, <span class="opt-value">rr</span>, <span class="opt-value">nn</span>, <span class="opt-value">ss</span>:</td>
            <td>hour-24, hour-12, minutes, seconds forced on two digits.</td>
          </tr>
          <tr>
            <td valign="top"><span class="opt-value">h</span>, <span class="opt-value">r</span></td>
            <td>hour-24, hour-12 </td>
          </tr>
          <tr>
            <td valign="top"><span class="opt-value">hm</span>, <span class="opt-value">ampm</span>, <span class="opt-value">AMPM</span> : </td>
            <td>12h format of the hour,  &quot;am&quot; or &quot;pm&quot; signal , &quot;AM&quot; or &quot;PM&quot; signal.</td>
          </tr>
          <tr>
            <td valign="top" class="opt-value">(locale)</td>
            <td>Display locale day and month's names. 
              The locale language can be set using the PHP function <span class="txt-code"><a href="http://php.net/setlocale" target="_blank">setlocale()</a></span>. It works only if locale parameters have been set on the server. For PHP reasons, in locale mode <span class="opt-value">xx</span> does not work and <span class="opt-value">d</span> does like <span class="opt-value">dd</span>. </td>
          </tr>
        </table>
        <br>
        Other characters are kept.
        It is possible to protect the strings inside by putting them between double quotes (&quot;).<br>
        <br>
        Examples:<br>
        <div class="decal">[<span class="opt-value"><span class="opt-name">fld</span></span>;<span class="opt-name">frm</span>=<span class="opt-value">mm/dd/yyyy</span>] will display <span class="opt-html">12/21/2002</span><br>
          [<span class="opt-value"><span class="opt-name">fld</span>;<span class="opt-name">frm</span>='yyyy-mm-dd hh:nn:ss'</span>] will display <span class="opt-html">2002-12-21 15:45:03</span></div>
        <div class="versioning">Versioning:<br>
          - Keywords ampm and AMPM are supported since TBS version 3.0.<br>
          - Keyword hm was supported since TBS 3.0 and is deprecated since TBS version 3.2.0.<br>
          - Keywords rr, r, and h are supported since TBS version 3.2.0.<br>
          - Keyword (locale) is supported since TBS version 3.4.0.</div>
        <br>
        <br>
        <br>
        <div class="title-1c">Numeric format:</div>
        <br>
        To define the decimal part, use an expression like '<span class="opt-value">0d0...</span>' where <span class="opt-value">'d'</span> is the decimal separator , and <span class="opt-value">'0...'</span> is a continuation of zeros corresponding to the number of decimals.<br>
        If there is no decimal, use the format '<span class="opt-value">0.</span>' (with a dot).<br>
        <br>
        To define a thousand separator, use an expression like '<span class="opt-value">0t000d...</span>' where <span class="opt-value">'t</span>' is the thousand separator. If there is no decimal, use the format '<span class="opt-value">0t000.</span>' (with a dot).<br>
        <br>
        In order to display leading zeros, use an expression like '<span class="opt-value">0000d...</span>' where <span class="opt-value">'0000</span>' represents the number of digits you want to have. If there is no decimal, use the format '<span class="opt-value">0000.</span>' (with a dot). <span class="versioning">Versioning: This feature is supported since TBS version 3.5.2.</span><br>
        <br>
        If the format contains the character '<span class="opt-value">%</span>', then the value to display will be multiplied by 100. The character '<span class="opt-value">%</span>' is displayed too.<br>
        <br>
        The numerical format may contain other strings. But only the expression with one or more zeroes placed to the right will be taken as a format, other characters will be kept.<br>
        <br>
        Examples:
        <div class="decal">
          <table border="0" cellspacing="0" cellpadding="1">
            <tr class="title-1b">
              <td width="100">Value</td>
              <td width="160">Field</td>
              <td width="100">Display</td>
            </tr>
            <tr>
              <td>2456.1426</td>
              <td>[<span class="opt-value"><span class="opt-name">fld</span></span>;<span class="opt-name">frm</span>='<span class="opt-value">0.000</span>']</td>
              <td class="opt-html">2456.143</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>[<span class="opt-value"><span class="opt-name">fld</span></span>;<span class="opt-name">frm</span>='<span class="opt-value">$ 0,000.00</span>']</td>
              <td class="opt-html">$ 2,456.14</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>[<span class="opt-value"><span class="opt-name">fld</span></span>;<span class="opt-name">frm</span>='<span class="opt-value">$ 0,000.</span>']</td>
              <td class="opt-html">2,456</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>[<span class="opt-value"><span class="opt-name">fld</span></span>;<span class="opt-name">frm</span>='<span class="opt-value">000000.</span>']</td>
              <td class="opt-html">002456</td>
            </tr>
            <tr>
              <td>0.2537</td>
              <td>[<span class="opt-value"><span class="opt-name">fld</span></span>;<span class="opt-name">frm</span>='<span class="opt-value">0.00 %</span>']</td>
              <td class="opt-html">25.37%</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>[<span class="opt-value"><span class="opt-name">fld</span></span>;<span class="opt-name">frm</span>='<span class="opt-value">coef 0.00</span>']</td>
              <td class="opt-html">coef 0.25</td>
            </tr>
          </table>
        </div>
        <br>
        <div class="title-1c">Conditional formats:</div>
        <br>
        You have the possibility to define up to 4 conditional formats when the value is respectively positive, negative, zero or null (or empty string). Conditional formats must be separated by a '|' character. Each conditional format is optional.<br>
        <br>
        Examples:
        <div class="decal">
          <table border="0" cellspacing="0" cellpadding="1">
            <tr class="title-1b">
              <td>Value</td>
              <td>Field</td>
              <td>Display</td>
            </tr>
            <tr>
              <td width="100">2456.1426</td>
              <td width="230">[<span class="opt-value"><span class="opt-name">chp</span></span>;<span class="opt-name">frm</span>='<span class="opt-value">+0.00|-(0.00)|*|empty</span>']</td>
              <td width="100" class="opt-html">+2456.14</td>
            </tr>
            <tr>
              <td>-156.333</td>
              <td>[<span class="opt-value"><span class="opt-name">chp</span></span>;<span class="opt-name">frm</span>='<span class="opt-value">+0.00|-(0.00)|*|</span><span class="opt-value">empty</span>']</td>
              <td class="opt-html">-(156.33)</td>
            </tr>
            <tr>
              <td>0</td>
              <td>[<span class="opt-value"><span class="opt-name">chp</span></span>;<span class="opt-name">frm</span>='<span class="opt-value">+0.00|-(0.00)|*|</span><span class="opt-value">empty</span>']</td>
              <td class="opt-html">*</td>
            </tr>
            <tr>
              <td>null</td>
              <td>[<span class="opt-value"><span class="opt-name">chp</span></span>;<span class="opt-name">frm</span>='<span class="opt-value">+0.00|-(0.00)|*|</span><span class="opt-value">empty</span>']</td>
              <td class="opt-html">empty</td>
            </tr>
            <tr>
              <td>-8.75</td>
              <td>[<span class="opt-value"><span class="opt-name">chp</span></span>;<span class="opt-name">frm</span>='<span class="opt-value">+0.00|-(0.00)</span>']</td>
              <td class="opt-html">-(8.75)</td>
            </tr>
          </table>
        </div></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_field_prm_locale" id="html_field_prm_locale"></a><span class="opt-name">locale</span></td>
      <td align="left" valign="top" class="border-sep"><span class="versioning">Deprecated since TBS version 3.4.0.</span><br>
        It does the same as the keyword <span class="opt-value">(locale)</span> used in parameter <a href="#html_field_prm_frm" class="opt-name">frm</a>. </td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_field_prm_tplfrms" id="html_field_prm_tplfrms"></a><span class="opt-name">tplfrms</span></td>
      <td align="left" valign="top" class="border-sep">Enables you to define formats in the template that you can reuse for parameter <a href="#html_field_prm_frm" class="opt-name">frm</a>. Works only with <span class="opt-name">onload</span> <a href="#html_field_auto">automatic fields</a>. <br>
        Example:<br>
        <div class="decal">[onload;<span class="opt-name">tplfrms</span>;<span class="opt-value">doll</span>=$ 0,000.00;<span class="opt-value">mydt</span>=yyyy-mm-dd]<br>
          [onshow.amount;<span class="opt-name">frm</span>=<span class="opt-value">doll</span>] ... [onshow.date;<span class="opt-name">frm</span>=<span class="opt-value">mydt</span>] <br>
        </div></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_field_prm_tplvars" id="html_field_prm_tplvars"></a><span class="opt-name">tplvars</span></td>
      <td align="left" valign="top" class="border-sep">Enables you to define variables in the template that you can retrieve in the Php programm using <a href="#php_tplvars">TplVars property</a>. Works only with <span class="opt-name">onload</span> <a href="#html_field_auto">automatic fields</a>. </td>
    </tr>
  </table>
  <br>
  <span class="opt-name"><a name="html_field_prm_order" id="html_field_prm_order"></a></span><br>
  <div class="title-1c">Order of processing  parameters:</div>
  <br>
  When you whant to use several paremeters in the same TBS field, then it can be intersing to undertsand in which order they are processed.<br>
  Each parameter is changing the  value to be merged, but the source from where the value is is taken is not changed. <br>
  <br>
  <span class="title-1b"> Order:</span><br>
  1) -&gt; Retreiving the value of the field to be merged.<br>
  2) -&gt; Changing the value using parameters: <br>
  &nbsp;&nbsp;&nbsp;&nbsp;2.1) -&gt; <a href="#html_field_prm_onformat" class="opt-name">onformat</a><br>
  &nbsp;&nbsp;&nbsp;&nbsp;2.2) -&gt; <a href="#html_field_prm_ope" class="opt-name">ope</a> / plug-ins OnOperation<br>
  &nbsp;&nbsp;&nbsp;&nbsp;2.3) -&gt; <a href="#html_field_prm_frm" class="opt-name">frm</a> / <span class="border-sep">XML/HTML</span> or other char conversion<br>
  &nbsp;&nbsp;&nbsp;&nbsp;2.4) -&gt; <a href="#html_field_prm_if" class="opt-name">if</a> <br>
  &nbsp;&nbsp;&nbsp;&nbsp;2.5) -&gt; <a href="#html_field_prm_file" class="opt-name">file</a><br>
  &nbsp;&nbsp;&nbsp;&nbsp;2.6) -&gt; <a href="#html_field_prm_script" class="opt-name">script</a><br>
  &nbsp;&nbsp;&nbsp;&nbsp;2.7) -&gt; <a href="#html_field_prm_script" class="opt-name">att</a><br>
  &nbsp;&nbsp;&nbsp;&nbsp;2.8) -&gt; . / <a href="#html_field_prm_ifempty" class="opt-name">ifempty</a> / <a href="#html_field_prm_magnet" class="opt-name">magnet</a><br>
  3) -&gt; Inserting the value in the template. </div>
<div class="title-2"><a name="html_field_auto" id="html_field_auto"></a>Automatic fields</div>
<div class="norm"> Automatic fields enable you to automatically merge PHP global variables  when some events occur.<br>
  For example [<span class="opt-name">onload</span>.x] will be merged with the global variable $x  when the <a href="#php_loadtemplate">LoadTemplate()</a> method is called<span class="title-1c"></span>.<br>
  <br>
  Automatic fields can only merge  PHP variables <span class="title-1c">when they are global</span>. There is no way to merge a variable which is local to a function, unless you make a reference to it with a global variable, or if you merge it using <a href="#php_mergefield">MergeField()</a>.<br>
  Automatic fields can also merge TBS special information (see <a href="#html_field_special">Special automatic fields</a>), or data of the ObjectRef property (see <a href="#php_oop">Objet Oriented Programming</a>).<br>
  <br>
  There are three types of automatic fields:<br>
  - <span class="opt-name">[onload]</span> fields, which are automatically merged  when the <a href="#php_loadtemplate">LoadTemplate()</a> method is called.<br>
  - <span class="opt-name">[onshow]</span> fields, which are automatically merged when the <a href="#php_show">Show()</a><a href="#php_loadtemplate"></a> method is called.<br>
  - <span class="opt-name">[var]</span> fields, which are automatically merged when the field they are embedded in is also merged itself, but it works only if they are placed into a parameter <a href="#html_field_prm_file" class="opt-name">file</a>, <a href="#html_field_prm_script" class="opt-name">script</a>, <a href="#html_field_prm_if" class="opt-name">if</a>, <span class="opt-name">then</span>, <span class="opt-name">else</span> or <a href="#html_block_prm_when" class="opt-name">when</a>.<br>
  <br>
  <div class="versioning">Versioning:<br>
    - 
    Automatic fields <span class="opt-name">[onload]</span> and <span class="opt-name">[onshow]</span> are supported since TBS version 3.2.0. For compatibility with versions prior to  3.2.0, remaining <span class="opt-name">[var]</span> fields are still merged as if there were <span class="opt-name">[onshow]</span> fields but is it recommended to use real <span class="opt-name">[onshow]</span> fields instead.<br>
    - <span class="opt-name">[var]</span> are processed into parameter <span class="opt-name">then</span> and <span class="opt-name">else</span> since  TBS version 2.02.</div>
  <br>
  Automatic fields may or may not have a sub name, like x in [onload.x], [onshow.x] or [var.x]. An automatic field without sub name will be merged with an empty string value  (''). Example: [<span class="opt-name">onload</span>;<span class="opt-name">file</span>=<span class="opt-value">header.html</span>] this field inserts a subtemplate when <a href="#php_loadtemplate">LoadTemplate()</a> method is called.<br>
  <br>
  An automatic field having a sub name will be merged with the corresponding global PHP variable.<br>
  If the global variable doesn't exist at this moment, then a TBS error is displayed, unless you add  parameter <a href="#html_field_prm_noerr" class="opt-name">noerr</a>.<br>
  <br>
  Examples:<br>
  <div class="decal">[<span class="opt-name">onload</span>.x] this field will be merged with the global variable $x when <a href="#php_loadtemplate">LoadTemplate()</a> is called.<br>
    [<span class="opt-name">onshow</span>.x] this field will be merged with the global variable $x when <a href="#php_show">Show()</a> is called.<br>
    [<span class="opt-name">b1</span>.col1;if [val]=[<span class="opt-name">var</span>.x];then <span class="opt-value">'good'</span>; else <span class="opt-value">'bad'</span>] : the  [<span class="opt-name">var</span>.x] field is merged in the same time as [<span class="opt-name">b1</span>.col1].</div>
  <br>
  You can also merge array's items, object's properties or object's methods using a dot (&quot;.&quot;) as separator. <span class="opt-html">Resource</span> variables are ignored.<br>
  For example (valid for both <span class="opt-name">[onload]</span>, <span class="opt-name">[onshow]</span> and <span class="opt-name">[var</span>]):<br>
  <div class="decal">
    <table border="0" cellpadding="3" cellspacing="0">
      <tr>
        <td>[<span class="opt-name">onshow</span>.tbl.item1] </td>
        <td width="5">&nbsp;</td>
        <td>will display </td>
        <td width="5" class="txt-code">&nbsp;</td>
        <td class="txt-code">$tbl[<span class="opt-value">'item1'</span>] </td>
      </tr>
      <tr>
        <td>[<span class="opt-name">onshow</span>.tbl.item2.a.0] </td>
        <td>&nbsp;</td>
        <td>will display</td>
        <td class="txt-code">&nbsp;</td>
        <td class="txt-code">$tbl[<span class="opt-value">'item2'</span>][<span class="opt-value">'a'</span>][<span class="opt-value">0</span>] </td>
      </tr>
      <tr>
        <td>[<span class="opt-name">onshow</span>.obj.prop1]</td>
        <td>&nbsp;</td>
        <td>will display </td>
        <td class="txt-code">&nbsp;</td>
        <td class="txt-code">$obj-&gt;prop1</td>
      </tr>
      <tr>
        <td>[<span class="opt-name">onshow</span>.obj.methA]</td>
        <td>&nbsp;</td>
        <td>will display</td>
        <td class="txt-code">&nbsp;</td>
        <td class="txt-code">$obj-&gt;methA()</td>
      </tr>
      <tr>
        <td>[<span class="opt-name">onshow</span>.obj.methB(x,y)]</td>
        <td>&nbsp;</td>
        <td>will display </td>
        <td class="txt-code">&nbsp;</td>
        <td class="txt-code">$obj-&gt;methB(<span class="opt-value">'x'</span>,<span class="opt-value">'y'</span>)</td>
      </tr>
      <tr>
        <td>[<span class="opt-name">onshow</span>.tbl.item3.prop2.item4</td>
        <td>&nbsp;</td>
        <td>will display</td>
        <td class="txt-code">&nbsp;</td>
        <td class="txt-code">$tbl[<span class="opt-value">'item3'</span>]-&gt;prop2[<span class="opt-value">'item4'</span>]</td>
      </tr>
    </table>
    <span class="versioning">Versioning: calling methods with arguments from an automatic field is supported since TBS version 3.0.</span></div>
  <br>
  Note: You can also force the merge of  [var] fields or other types at anytime using the <a href="#php_mergefield">MergeField()</a> method.<br>
  <br>
  <span class="title-1b">Embedded automatic fields</span><br>
  An embedded TBS field is never merged, unless :<br>
  - it is merged before the parent field,<br>
  - il is a <span class="opt-name">[var]</span> field placed into a paremeter <a href="#html_field_prm_file" class="opt-name">file</a>, <a href="#html_field_prm_script" class="opt-name">script</a>, <a href="#html_field_prm_if" class="opt-name">if</a>, <span class="opt-name">then</span>, <span class="opt-name">else</span> or <a href="#html_block_prm_when" class="opt-name">when</a>.<br>
  <br>
  Examples: <br>
  <div class="decal"> <span class="opt-html">[onload;if [onload.x]=1;then 'yes';else 'no']</span><br>
    This example will always display <span class="opt-html">'no'</span>, because the embedded <span class="opt-html">[onload.x]</span> fild will never be evaluated. It is better to use <span class="opt-html">[onload;if [var.x]=1;then 'yes';else 'no']</span> instead, or better : <span class="opt-html">[onload.x;if [val]=1;then 'yes';else 'no']</span><br>
    <br>
    <span class="opt-html">[b1.nom;block=tr;headergrp=[var.x]]</span><br>
    In this example,  [var.x] will not be merged yet when you call <span class="txt-code"><span class="opt-value">$TBS-&gt;MergeBlock('b1',...)</span></span><br>
    The header will then be defined badly. <br>
    It needs one of those: <br>
    - using an onload field: <span class="opt-html">[b1.name;block=tr;headergrp=[onload.x]]</span><br>
    - 
    calling <span class="opt-value"><span class="txt-code">$TBS-&gt;MergeField('var') </span></span>avant<span class="opt-value"><span class="txt-code"> $TBS-&gt;MergeBlock('b1',...)</span></span><br>
    - using a customized field name: <span class="opt-html">[b1.name;block=tr;headergrp=[zzz]]</span> manually merged with <span class="opt-value"><span class="txt-code">$TBS-&gt;MergeField('zzz',$x)</span></span></div>
  <br>
  <span class="title-1b">Security: how to limit automatic fields usage in templates?</span><br>
  <br>
  You can limit the automatic fields usage by defining an Allowed Variable Prefix when you create the TinyButStrong object.<br>
  <div class="decal">Example :<br>
    <span class="txt-code"><span class="opt-name">&nbsp;&nbsp;$TBS</span> = new clsTinyButStrong(<span class="opt-value">''</span>,<span class="opt-value">'x1_'</span>);</span><br>
    In this example, only PHP global variables prefixed by <span class="opt-value">'x1_'</span> are allowed in the template. Other automatic fields will produce an explicit error message when merged.<br>
    &nbsp;&nbsp;[<span class="opt-name">onload</span>.x1_title] will be merged if the global variable <span class="opt-name">$x1_title</span> exists. <br>
    &nbsp;&nbsp;[<span class="opt-name">onload</span>.x2_title] will produce an explicit error message.<br>
    <br>
    NB: the first parameter <span class="opt-value">''</span> of clsTinyButStrong() in the example above is used to define TBS tag delimiters. But this is not described in this manual. <br>
  </div>
  <br>
</div>
<div class="title-2"><a name="html_field_special" id="html_field_special3"></a>Special automatic fields :</div>
<div class="norm"> A Special [var] field is a TBS Field which displays data provided by the TinyButStrong system.<br>
  The name of a Special [var] field has to begin with '<span class="opt-name">var..</span>', followed by a keyword in the list below.<br>
  The parameters for standard TBS Fields are available for Special [var] fields.<br>
  <br>
  Example: <span class="opt-html">Date of the day : </span>[onshow.<span class="opt-name">.now</span>;frm='mm-dd-yyyy'] <br>
  <br>
  (valid for both <span class="opt-name">onload</span>, <span class="opt-name">onshow</span> et <span class="opt-name">var</span>) <br>
  <table border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="80" align="left" valign="top">Name</td>
      <td align="left" valign="top">Description</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">onshow..now</td>
      <td align="left" valign="top">Date and hour of the server.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">onshow..version</td>
      <td align="left" valign="top"> The version of TinyButStrong. </td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">onshow..script_name</td>
      <td align="left" valign="top">The name of the PHP file currently executing.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">onshow..template_name</td>
      <td align="left" valign="top">The name of the last loaded template file.<br>
        It is the name given to the <a href="#php_loadtemplate">LoadTemplate()</a> method.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">onshow..template_date</td>
      <td align="left" valign="top">The creation date of the last loaded template file.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">onshow..template_path</td>
      <td align="left" valign="top">The directory of the last loaded template file.<br>
        It is the directory given to the <a href="#php_loadtemplate">LoadTemplate()</a> method.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">onshow..tplvars.*</td>
      <td align="left" valign="top">The value of an item set in the <a href="#php_tplvars">TplVars</a> property.<br>
        ('*' must be the key of an existing item in the array)</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">onshow..cst.*</td>
      <td align="left" valign="top">The value of a PHP constant.<br>
        (* must be the name of an existing constant) </td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">onshow..tbs_info</td>
      <td align="left" valign="top">Information about TBS and installed plug-ins. </td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">onshow..error_msg</td>
      <td align="left" valign="top">Display errors that have been avoid during the time when property <a href="#php_noerr">NoErr</a> is set to <span class="opt-value">true</span>.</td>
    </tr>
  </table>
  <br>
  <div class="versioning">Versioning:<br>
    - 
    special var fields &quot;cst&quot; and &quot;tbs_info&quot; are supported since TBS version 3.2.0.<br>
    - 
    &quot;error_msg&quot; is supported since TBS version 3.5.0. </div>
</div>
<div class="title-2"><a name="html_block" id="html_block"></a>TBS Blocks:</div>
<div class="norm">A TBS block enables you define a zone and to display data from a record source.<br>
  You can define a TBS block using one or two TBS tags (see below). <br>
  <br>
  <span class="title-1b">Merging with data:</span> <br>
  Merging a block with  data is done using the <a href="#php_mergeblock">MergeBlock()</a> method. When a  TBS block is merged with data,  it is repeated as many times as there are records; and the associated TBS fields are replaced by the value of the columns stored in the current record.<br>
  A TBS field associated to a block is identified by its name which should be made of the name of the block followed by the  name of the column to display and separated by a dot.<br>
  Examples:<br>
  <div class="decal"> - [<span class="opt-name">Block1</span>.<span class="opt-name">ColA</span>]   This field will display the value of column <span class="opt-name">ColA</span> when block <span class="opt-name">Block1</span> is merged. <br>
    - [<span class="opt-name">Blokc1</span>.<span class="opt-name">ColB</span>;<span class="opt-name">frm</span>=<span class="opt-value">'dd-mm-yyyy'</span>] Another field but with a TBS parameter. </div>
  <br>
  <span class="versioning">Since TBS version 3.5.0 column names with spaces are accepted.</span><br>
  <br>
  <span class="title-1b">Remark:</span> when two separated blocks have the same name, then they will be considered has two sections of the same block. All content placed between those two sections of a block  will be <span class="title-1c">ignored and deleted</span> during the merging. See <a href="#html_block_section">sections of blocks</a> to know more about sections.<br>
  <br>
  <br>
  <div class="title-1c">Block syntaxes:</div>
  <br>
  There are three possible syntaxes to define a TBS block:<br>
  <br>
  <div class="title-1b">Explicit Syntax:</div>
  <div class="decal">Two TBS tags are used. One for the beginning of the block and another for the end of the block.<span class="opt-html"></span><span class="opt-html"></span>
    <div class="decal">Example:<br>
      <span class="opt-html"><strong>TEMPLATE...</strong></span>[<span class="opt-name">BlockName</span>;<span class="opt-name">block</span>=<span class="opt-value">begin</span><span class="opt-value">;<span class="opt-name">params</span></span>]<span class="opt-html"><strong>...TEMPLATE...</strong></span>[<span class="opt-name">BlockName</span>;<span class="opt-name">block</span>=<span class="opt-value">end</span>]<span class="opt-html"><strong>...TEMPLATE</strong></span></div>
    Those TBS tags for the block definition will be deleted during the merging.</div>
  <br>
  <div class="title-1b">Relative Syntax:</div>
  <div class="decal">The block is defined by a pair of opening-closing XML/HTML tags which is given by a single TBS tag.
    <div class="decal">Example:<br>
      <span class="opt-html"><strong>TEMPLATE...&lt;tag_name...&gt;...</strong></span>[<span class="opt-name">BlockName</span>;<span class="opt-name">block</span>=<span class="opt-value">tag_name;<span class="opt-name">params</span></span>]<span class="opt-html"><strong>...&lt;/tag_name...&gt;...TEMPLATE</strong></span></div>
    This TBS tag for the block definition must be placed between the pair of XML/HTML tags.<br>
    This TBS tag will be deleted during the merging.<br>
    <span class="title-1b">Remark:</span> You can aslo define a block's zone by a combination of XML/HTML tags. See  parameter <a href="#html_block_prm_block" class="opt-name">block</a> for more details. </div>
  <br>
  <div class="title-1b">Simplified Syntax:</div>
  <div class="decal">An associated TBS field is used to define the block in a relative way (see the relative syntax above).
    <div class="decal">Example:<br>
      <span class="opt-html"><strong>TEMPLATE...&lt;tag_name...&gt;...</strong></span>[<span class="opt-name">BlockName</span>.<span class="opt-name">ColumnName</span>;<span class="opt-name">block</span>=<span class="opt-value">tag_name;<span class="opt-name">params</span></span>]<span class="opt-html"><strong>...&lt;/tag_name...&gt;...TEMPLATE</strong></span></div>
    The TBS tag for the block definition (i.e. the <span class="opt-name">block</span>=<span class="opt-value">...</span> parameter) must be placed between the pair of XML/HTML tags. You are nor obliged to put the parameter <span class="opt-name">block</span> on the first field, it can be any of them inside the zone defined by the block. <br>
    <span class="title-1b">Remarks:</span> <br>
    &bull; 
    You should not repeat the parameter <span class="opt-name">block</span>=<span class="opt-value">...</span> on each fields of the bloc, only one is enough. If you place several of them, this will be accepted by TBS but it may bring confusions about complementary parameters for block.<br>
    &bull; You can aslo define a block's zone by a combination of XML/HTML tags. See  parameter <a href="#html_block_prm_block" class="opt-name">block</a> for more details. </div>
  <br>
  <div class="note">
    <div class="title-1b">Which syntax to use?</div>
    <br>
    The 'absolute' syntax is rarely used with Visual Editors because TBS tags have often to be placed between two XML/HTML tags. On the other hand, it is convenient for textual editors.<br>
    <br>
    The 'relative' syntax enables you to indicate a block using only one TBS tag. Furthermore, there is no need to hide the TBS tag because it will be deleted during the displaying. This syntax is quite practical.<br>
    <br>
    The 'simplified' syntax is really simple. It enables you to define a TBS block and a TBS Field with only one TBS tag. This syntax is the most current and the most practical.<br>
    <br>
    <div class="title-1b">Tip:</div>
    You can use the 'relative' or the 'absolute' syntax with custom tags using the XML/HTML standard.<br>
    Example:<br>
    <span class="opt-html">&lt;custom_tag&gt;</span>Hello [<span class="opt-name">blk1</span>.<span class="opt-name">column1</span>;<span class="opt-name">block</span>=<span class="opt-value">custom_tag</span>], how are you?<span class="opt-html">&lt;/custom_tag&gt;</span><br>
  </div>
  <br>
  <table border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="80" align="left" valign="top">Element</td>
      <td align="left" valign="top">Description</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">BlockName</td>
      <td align="left" valign="top">The name of the TBS block.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="opt-name">params</td>
      <td align="left" valign="top"> Optional. One or several parameters from the list below. Separated with ';'.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><span class="opt-name">block</span>=<span class="opt-value">begin</span></td>
      <td align="left" valign="top">Indicates the beginning of the block.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><span class="opt-name">block</span>=<span class="opt-value">end</span></td>
      <td align="left" valign="top">Indicates the end of the block.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><span class="opt-name"><span class="opt-value"><a name="html_block_prm_block" id="html_block_prm_block"></a></span>block</span>=<span class="opt-value">tag</span><br>
        <span class="txt-small">or</span><br>
        <span class="opt-name">block</span>=<span class="opt-value">expr</span><br></td>
      <td align="left" valign="top">Define a block bounded between the opening XML/HTML tag <span class="opt-html">&lt;tag...&gt;</span> and the closing XML/HTML tag <span class="opt-html">&lt;/tag&gt;</span> which surround the TBS tag. The couple of indicated XML/HTML tags are integral part of the bloc.<br>
        Example:<br>
        <div class="decal"><span class="opt-html">&lt;table id=&quot;tab1&quot;&gt;</span>&nbsp;<span class="blockzone"><span class="opt-html">&lt;tr&gt;&lt;td&gt;</span>[<span class="opt-name">b1</span>.<span class="opt-name">field1</span>;<span class="opt-name">block</span>=tr]<span class="opt-html">&lt;/td&gt;&lt;/tr&gt;</span></span><span class="opt-html">&lt;/table&gt;</span><br>
          <span class="txt-small">The block is defined by the zone framed by pointillets.</span> </div>
        <br>
        <span class="title-1b">Special marks:</span><br>
        <table border="0" cellspacing="0" cellpadding="4">
          <tr>
            <td width="80" valign="top"><span class="opt-name">block</span>=<span class="opt-value">_</span></td>
            <td valign="top">Define a block on the text line which holds the TBS tag. A text line always ends with a new-line char. New lines for Windows, Linux and  Mac are supported. This feature is very useful for a template with text contents for example.</td>
          </tr>
          <tr>
            <td valign="top"><span class="opt-name">block</span>=<span class="opt-value">tag/</span></td>
            <td valign="top">By adding character / at the end of the tag's name, TBS won't retrieve the closing tag. The block will be defined on the single opening XML/HTML tag which contains the TBS tag. This can be useful to multiply an image for example. </td>
          </tr>
        </table>
        <br>
        <br>
        <br>
        <div class="versioning">Versioning: special marks  &quot;_&quot; and &quot;/&quot; are supported since TBS 3.1.0.</div>
        <br>
        <a name="html_block_prm_extblk" id="html_block_prm_extblk"></a><span class="title-1b">Extended blocks:</span> <br>
        You can extend the block's zone  (or the section's zone) beyond the simple XML/HTML tag or special marks by using the following expressions:<br>
        <br>
        Note that special marks (see above) can be used for extended blocks.<br>
        <br>
        To extend the block's zone on several successive tags:<br>
        <div class="decal"><span class="opt-html">&lt;table&gt;</span><span class="blockzone"><span class="opt-html">&lt;tr&gt;</span>[<span class="opt-name">b1</span>.<span class="opt-name">field1</span>;<span class="opt-name">block</span>=<span class="opt-value">tr</span>+<span class="opt-value">tr</span>+<span class="opt-value">tr</span>]<span class="opt-html">&lt;/tr&gt;<span class="blocksep">&lt;</span>tr&gt;...&lt;/tr&gt;<span class="blocksep">&lt;</span>tr&gt;...&lt;/tr&gt;</span></span>&lt;/table&gt;<br>
          <span class="txt-small">Note: you can specify tags of different types</span></div>
        <br>
        To extend the block's zone on several successive tags placed before: <br>
        <div class="decal"><span class="opt-html">...</span> <span class="blockzone"><span class="opt-html">&lt;span&gt;...&lt;/span&gt;<span class="blocksep">&lt;</span>div&gt;</span>[<span class="opt-name">b1</span>.<span class="opt-name">field1</span>;<span class="opt-name">block</span>=<span class="opt-value">span</span>+(<span class="opt-value">div)</span>]<span class="opt-html">&lt;/div&gt;</span></span> <span class="opt-html">...</span> <br>
          Other example: <br>
          <span class="opt-html">...</span> <span class="blockzone"><span class="opt-html">&lt;span&gt;...&lt;/span&gt; <span class="blocksep">&lt;</span>div&gt;</span>[<span class="opt-name">b1</span>.<span class="opt-name">field1</span>;<span class="opt-name">block</span>=<span class="opt-value">span</span>+(<span class="opt-value">div)</span>+<span class="opt-value">table</span>]<span class="opt-html">&lt;/div&gt; <span class="blocksep">&lt;</span>table&gt;...&lt;/table&gt;</span></span> <span class="opt-html">...</span> <br>
          The tag placed bewteen brackets means the one which  contains the block's definition.</div>
        <br>
        To extend the block's zone on a tag of the same type but with a higher encapsulation level: <br>
        <div class="decal"><span class="blockzone"><span class="opt-html">&lt;div&gt; &lt;div&gt;</span> [<span class="opt-name">b1</span>.<span class="opt-name">field1</span>;<span class="opt-name">block</span>=<span class="opt-value">((div))</span>] <span class="opt-html">&lt;/div&gt; &lt;/div&gt;</span></span> <br>
          The number of bracket means le encapsulation level of the tags. </div>
        <br>
        <div class="versioning">Versioning : The Extended Blocks feature is supported since  TBS version 3.0. Before that, you had to use parameters 'extend' and 'encaps' which are not supported anymore. </div></td>
    </tr>
  </table>
  <a name="html_block_prm" id="html_block_prm"></a>
  <div class="title-1c">Block's parameters:</div>
  <br>
  <table border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="80" align="left" valign="top">Parameter</td>
      <td align="left" valign="top">Description</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_block_prm_nodata" id="html_block_prm_nodata"></a><span class="opt-name">nodata</span></td>
      <td align="left" valign="top" class="border-sep">Indicates a section that is displayed only if there is no data to merge.<br>
        <br>
        Example:<br>
        <div class="decal">
          <table width="349" cellpadding="2" cellspacing="0" class="border-1">
            <tr>
              <td width="178" class="border-1">[b1.field1;<span class="opt-name">block</span>=<span class="opt-value">tr</span>]</td>
              <td width="157" class="border-1">[b1.field2]</td>
            </tr>
            <tr>
              <td colspan="2" class="border-1">[b1;<span class="opt-name">block</span>=<span class="opt-value">tr</span>;<span class="opt-name">nodata</span>]<font color="#FF3300">There is no data.</font></td>
            </tr>
          </table>
        </div>
        <br>
        For more information about sections, see the chapter '<a href="#html_block_section">Sections of blocks</a>'.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_block_prm_bmagnet" id="html_block_prm_bmagnet"></a><br>
        <span class="opt-name">bmagnet</span>=<span class="opt-value">tag</span><br>
        <span class="txt-small">or</span><br>
        <span class="opt-name">bmagnet</span>=<span class="opt-value">expr</span></td>
      <td align="left" valign="top" class="border-sep">Indicates an XML/HTML zone which must be deleted if the block is merged with no record (an emprt query, for example, or a PHP Array with no items). Parameter <span class="opt-name">bmagnet</span> supports the same syntax as parameter <a href="#html_block_prm_block" class="opt-name">block</a>, i.e. that <span class="opt-value">expr</span> must be an XML/HTML tag or a TBS <a href="#html_block_prm_extblk">extended block</a> expression.<br>
        Example:
        <div class="decal">
          <table cellpadding="2" cellspacing="0" class="border-1">
            <tr>
              <td class="border-1">[b1.field1;<span class="opt-name">block</span>=<span class="opt-value">tr</span>;<span class="opt-name">bmagnet</span>=<span class="opt-value">table</span>]</td>
              <td class="border-1">[b1.field2]</td>
            </tr>
          </table>
          <span class="txt-small">In this example, the table will be deleted if there is no record to merge.</span> </div>
        <br>
        <span class="title-1b">Remark:</span> <br>
        Value <span class="opt-value">null</span> is not accepted by  MergeBlock() method as a data source, and it makes a TBS error instead of deleting the <span class="opt-name">bmagnet</span> zone. If you data source may be null, then you should make a check previously. <br>
        Example:
        <div class="decal"><span class="txt-code">if (is_null(<span class="opt-name">$data</span>)) <span class="opt-name">$data</span> = array();<br>
          <span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'b1'</span>,<span class="opt-name">$data</span>);</span></div>
        <div class="versioning">Versioning: parameter bmagnet is supported since   TBS version 3.0.</div></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_block_prm_headergrp" id="html_block_prm_headergrp"></a>headergrp</span>=<span class="opt-value">colname</span></td>
      <td align="left" valign="top" class="border-sep">Indicates a header section that is displayed each time the value of column <span class="opt-value">colname</span> changes.<span class="opt-value"><br>
        colname</span> must be a valid column name returned by the data source.<br>
        <span class="versioning">Since TBS version 3.3.0</span>, <span class="opt-value">colname</span> can also be a virtual column <a href="#php_mergeblock_counting"># or $</a>, and it also support the subitems syntaxe of TBS fields.<br>
        You can define several <span class="opt-name">headergrp</span> sections with different columns. Placement's order of <span class="opt-name">headergrp</span> sections in the block can modify the result. <br>
        For more information about sections, see the chapter '<a href="#html_block_section">Sections of blocks</a>'.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_block_prm_footergrp" id="html_block_prm_footergrp"></a>footergrp</span>=<span class="opt-value">colname</span></td>
      <td align="left" valign="top" class="border-sep">Indicates a footer section that is displayed each time the value of column <span class="opt-value">colname</span> changes. See <span class="opt-name">headergrp</span>. </td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_block_prm_splittergrp" id="html_block_prm_splittergrp"></a>splittergrp</span>=<span class="opt-value">colname</span></td>
      <td align="left" valign="top" class="border-sep">Indicates a splitter section that is displayed each time the value of column <span class="opt-value">colname</span> changes. See <span class="opt-name">headergrp</span>. </td>
    </tr>
    <tr id="v202_parentgrp">
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_block_prm_parentgrp" id="html_block_prm_parentgrp"></a>parentgrp</span>=<span class="opt-value">colname</span></td>
      <td align="left" valign="top" class="border-sep">Indicates a parent section that is displayed each time the value of column <span class="opt-value">colname</span> changes. Unlike other sections, a <span class="opt-name">parentgrp</span> section allows normal sections inside itself. It's a way to define both a header and a footer in one section. </td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_block_prm_serial" id="html_block_prm_serial"></a><span class="opt-name">serial</span></td>
      <td align="left" valign="top" class="border-sep">Indicates that the block is a main block which contains serial secondary blocks.<br>
        For more information, see the chapter '<a href="#html_block_serial">serial display (in columns)</a>'.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_block_prm_p1" id="html_block_prm_p1"></a>p1</span>=<span class="opt-value">val1</span></td>
      <td align="left" valign="top" class="border-sep">Indicates the use of a dynamic query. All the occurrences of the string '<span class="opt-value">%p1%</span>' found in the query given to the MergeBlock() method are replaced by the value <span class="opt-value">val1</span>.      For more information, see the chapter <a href="#html_block_dynsb">Subblocks with dynamic queries</a>.<br>
        If it used without any value, that enables you to merge several blocks of the same name. See <a href="#php_mergeblock_mergeseveral">&quot;Merging several blocks with the same data&quot;</a> for more details.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_block_prm_sub1" id="html_block_prm_sub1"></a>sub1</span>=<span class="opt-value">column1</span></td>
      <td align="left" valign="top" class="border-sep">Define the column containing the data for an automatic subblock.<br>
        For more information, see the chapter <a href="#html_block_subauto">Automatic subblocks</a>.</td>
    </tr>
    <tr id="v205_ondata">
      <td align="left" valign="top" class="border-sep"><span class="opt-value"><a name="html_block_prm_ondata" id="html_block_prm_ondata"></a></span><span class="opt-name">ondata</span>=<span class="opt-value">fct_name</span></td>
      <td align="left" valign="top" class="border-sep"> Indicates the name of a user Php function that will be executed during the block merging.<br>
        Since TBS version 3.0, it's also possible to indicate a method of a class (see <a href="#php_oop">OOP</a>).<br>
        The function is called each time a record is taken from the data source. You can use the arguments of such  a Php function to edit  records before they are merged. The function  must have the following syntax:<br>
        <span class="txt-code">&nbsp;&nbsp;function <span class="opt-value">fct_name</span>(<span class="opt-name">$BlockName</span>,&amp;<span class="opt-name">$CurrRec</span>,<span class="opt-name">$RecNum</span>) { ... }<br>
        </span> <span class="opt-name"> </span>
        <table border="0" cellspacing="0" cellpadding="2">
          <tr class="title-1b">
            <td width="80" valign="top">Argument</td>
            <td>Description</td>
          </tr>
          <tr>
            <td valign="top"><span class="opt-name">$</span><span class="opt-name">BlockName</span></td>
            <td>Returns the name of the block calling the function (read only).</td>
          </tr>
          <tr>
            <td valign="top" class="opt-name">$CurrRec</td>
            <td>Returns an associative PHP array containing the current record (read/write<span class="txt-small"> <em>; don't forget the &amp; in the function header</em></span>).<br>
              If you set this variable to <span class="opt-value">False</span>, it ends the merging like it was the end of the record set.</td>
          </tr>
          <tr>
            <td valign="top"><span class="opt-name">$</span><span class="opt-name">RecNum</span></td>
            <td>Returns the number of the current record (read only, first record is number 1).</td>
          </tr>
        </table>
        <span class="title-1b">Examples:</span>
        <div class="decal txt-code"> function f_add_column(<span class="opt-name">$BlockName</span>,<span class="opt-name">&amp;$CurrRec</span>,<span class="opt-name">$RecNum</span>) {<br>
          &nbsp;&nbsp;<span class="opt-name">$CurrRec</span>[<span class="opt-value">'len'</span>] = strlen(<span class="opt-name">$CurrRec</span>[<span class="opt-value">'text'</span>]); <br>
          } </div></td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><span class="opt-name"><a name="html_block_prm_when" id="html_block_prm_when"></a>when</span> <span class="opt-value">expr1</span><span class="opt-name">=</span><span class="opt-value">expr2</span></td>
      <td align="left" valign="top" class="border-sep">Make the section conditional and define its condition. A conditional section is displayed only if its condition is verified.<br>
        Supported operators are:<br>
        <div class="decal">
          <table  border="0" cellpadding="0" cellspacing="2">
            <tr>
              <td width="60"><span class="opt-name">=</span> or <span class="opt-name">==</span></td>
              <td>equal</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td class="opt-name">!=</td>
              <td>not equal </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td class="opt-name">+-</td>
              <td>greater than </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td class="opt-name">+=-</td>
              <td>greater than or equal to </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td class="opt-name">-+</td>
              <td>less than </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td class="opt-name">-=+</td>
              <td>less than or equal to </td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td class="opt-name">~=</td>
              <td><span class="opt-value">expr1</span> match the regular expression <span class="opt-value">expr2</span> <br>
                <span class="txt-small">(for experimented users)</span></td>
              <td><div class="versioning">Versioning: added in TBS 3.0 </div></td>
            </tr>
          </table>
        </div>
        Both <span class="opt-value">expr1</span> and <span class="opt-value">expr2</span> must be string or numerical expressions. The expressions may contain <a href="#html_field_auto">[var] fields</a>.<br>
        <span class="title-1b">Example:</span>
        <div class="decal"><span class="opt-html">&lt;div&gt;</span>[<span class="opt-name">onload</span>;<span class="opt-name">block</span>=<span class="opt-value">div</span>;<span class="opt-name">when</span> [<span class="opt-name">var</span>.<span class="opt-name">x</span>]~=<span class="opt-value">'*to*'</span>] ... <span class="opt-html">&lt;/div&gt;</span><br>
          <span class="txt-small">The  &lt;div&gt; block will be displayed only if $x&gt;0. </span></div>
        <br>
        <span class="title-1b">Note:</span> do not confuse parameter <span class="opt-name">when</span> (which works only for TBS blocs or sections) and parameter <span class="opt-name">if</span> (which works only for TBS fields). Thus, parameter <span class="opt-name">when</span> is taken into account only if parameter <span class="opt-name">block</span> exists in the same TBS tag.<br>
        See <a href="#html_conditional">conditional blocks</a> for more details.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_block_prm_default" id="html_block_prm_default"></a><span class="opt-name">default</span></td>
      <td align="left" valign="top" class="border-sep">Indicates a section of block that must be displayed only if no conditional section of the same block has been displayed.</td>
    </tr>
    <tr>
      <td align="left" valign="top" class="border-sep"><a name="html_block_prm_several" id="html_block_prm_several"></a><span class="opt-name">several</span></td>
      <td align="left" valign="top" class="border-sep">Indicates that several conditional sections of the block can be displayed if several conditions are true. By default, conditional sections are exclusive.</td>
    </tr>
  </table>
</div>
<div class="title-2"> <a name="html_block_section" id="html_block_section"></a>Sections of block:</div>
<div class="norm">Different blocks having the same name will be regarded as sections of the same block.<br>
  Sections can be used to:<br>
  - alternate the display (normal sections),<br>
  - display something if there is no data (NoData section),<br>
  - display a header each time the value of a column changes (grouping sections).<br>
  <br>
  <span class="title-1b">Normal sections:</span><br>
  <br>
  When you define several normal sections, they will be used alternatively for each record.<br>
  <br>
  <div class="decal">Example:<br>
    <br>
    <table width="200" cellpadding="2" cellspacing="0" class="border-1">
      <tr>
        <td bgcolor="#F0FCFF" class="border-1">[<span class="opt-name">b1</span>.caption;<span class="opt-name">block</span>=tr]</td>
      </tr>
      <tr>
        <td bgcolor="#D2FFE9" class="border-1">[<span class="opt-name">b1</span>.caption;<span class="opt-name">block</span>=tr]</td>
      </tr>
    </table>
    <br>
    <span class="txt-small">In this example, the block named 'b1' contains two normal sections. Records will be displayed alternatively with a green background and with a blue background.</span></div>
  <br>
  <span class="title-1b">NoData section:</span><br>
  <br>
  The NoData section is a section displayed only if the data source has no records. There can be only one NoData section in a block. The NoData section is defined by adding the parameter <span class="opt-name">nodata</span>.<br>
  <br>
  <div class="decal">Example:<br>
    <br>
    <table width="250" cellpadding="2" cellspacing="0" class="border-1">
      <tr>
        <td class="border-1">[<span class="opt-name">b1</span>.caption;<span class="opt-name">block</span>=tr]</td>
      </tr>
      <tr>
        <td bgcolor="#FFCCCC" class="border-1"><span class="opt-html">There is nothing. </span>[<span class="opt-name">b1</span>;<span class="opt-name">block</span>=tr;<span class="opt-name">nodata</span>]</td>
      </tr>
    </table>
  </div>
  <br>
  <span class="title-1b">Grouping sections:</span><br>
  <br>
  Grouping sections are displayed every time a column's value in the record-set changes. You can define header, footer, splitter or parent sections using parameters <span class="opt-name">headergrp</span>, <span class="opt-name">footergrp</span>, <span class="opt-name">splittergrp</span>, and <span class="opt-name">parentgrp</span>. See <a href="#html_block_prm_headergrp">block's parameters</a> for more details.<br>
  <br>
  <div class="decal">Example:<br>
    <br>
    <table width="300" cellpadding="2" cellspacing="0" class="border-1">
      <tr>
        <td colspan="2" class="border-1"><span class="title-1c">Year:</span> [<span class="opt-name">b1</span>.year;<span class="opt-name">block</span>=tr;<span class="opt-name">headergrp</span>=year] </td>
      </tr>
      <tr>
        <td class="border-1">[<span class="opt-name">b1</span>.caption;block=tr]</td>
        <td class="border-1">[<span class="opt-name">b1</span>.amount]</td>
      </tr>
    </table>
  </div>
  <br>
  <div id="v202_section_cond"> <span class="title-1b">Conditional sections:</span><br>
    <br>
    Conditional sections are displayed only if their condition is verified. The condition for display is defined using parameter <a href="#html_block_prm_when" class="opt-name">when</a>. As soon as a section has this parameter, it becomes conditional. See <a href="#html_conditional">Conditional display</a> for more details.<br>
    <br>
    <div class="decal">Example:<br>
      <br>
      <table width="300" cellpadding="2" cellspacing="0" class="border-1">
        <tr>
          <td class="border-1">[<span class="opt-name">b1</span>.name;<span class="opt-name">block</span>=tr]</td>
        </tr>
        <tr>
          <td bgcolor="#DDDDDD" class="border-1">[<span class="opt-name">b1</span>.address;<span class="opt-name">block</span>=tr;<span class="opt-name">when</span> [<span class="opt-name">b1</span>.add_ok]==1]</td>
        </tr>
      </table>
    </div>
    <br>
  </div>
</div>
<div class="title-2"><a name="html_block_serial" id="html_block_serial"></a>Serial display (in columns):</div>
<div class="norm">The serial display enables you to display several records inside a block. For this, you have to use a main block and secondary blocks.<br>
  <br>
  <div class="decal">Example:<br>
    <br>
    <table width="200" cellpadding="4" cellspacing="0" class="border-2">
      <tr>
        <td class="border-2"><table width="100%" cellpadding="0" cellspacing="0" class="border-1">
            <tr>
              <td width="25%" height="14" class="border-1"><div align="center">Rec 1</div></td>
              <td width="25%" class="border-1"><div align="center">Rec 2</div></td>
              <td width="25%" class="border-1"><div align="center">Rec 3</div></td>
              <td width="25%" class="border-1"><div align="center">Rec 4</div></td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td class="border-2"><table width="100%" cellpadding="2" cellspacing="0" class="border-1">
            <tr>
              <td width="25%" class="border-1"><div align="center">Rec 5</div></td>
              <td width="25%" class="border-1"><div align="center">Rec 6</div></td>
              <td width="25%" class="border-1"><div align="center">Rec 7</div></td>
              <td width="25%" class="border-1"><div align="center">Rec 8</div></td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td class="border-2"><table width="100%" cellpadding="2" cellspacing="0" class="border-1">
            <tr>
              <td width="25%" class="border-1"><div align="center">Rec 9</div></td>
              <td width="25%" class="border-1"><div align="center">...</div></td>
              <td width="25%" class="border-1"><div align="center">...</div></td>
              <td width="25%" class="border-1"><div align="center">...</div></td>
            </tr>
          </table></td>
      </tr>
    </table>
    <br>
    <span class="txt-small">In this example, main blocks are the blue lines of the table, the secondary blocks are the pink cells.</span></div>
  <br>
  <div class="title-1b">Syntax:</div>
  The main block and its secondary blocks are merged using only one call to the MergeBock() method. The main block must be defined using the parameter <span class="opt-name">serial</span>. The secondary blocks must be nested into the main block. The secondary block's names must be the name of the main block followed by &quot;_&quot; and a number indicating display order.<br>
  <br>
  <div class="decal">Example:<br>
    <br>
    <table width="200" cellpadding="4" cellspacing="0" class="border-2">
      <tr>
        <td class="border-2"><table width="100%" cellpadding="2" cellspacing="0" class="border-1">
            <tr>
              <td width="25%" class="border-1"><div align="center">[bx;block=tr;serial][bx_1.txt;block=td]</div></td>
              <td width="25%" class="border-1"><div align="center">[bx_2.txt;block=td]</div></td>
              <td width="25%" class="border-1"><div align="center">[bx_3.txt;block=td]</div></td>
              <td width="25%" class="border-1"><div align="center">[bx_4.txt;block=td]</div></td>
            </tr>
          </table></td>
      </tr>
    </table>
    <br>
    <span class="txt-small">The corresponding PHP is:</span><br>
    <span class="txt-code"> &nbsp;$TBS-&gt;MergeBlock('<font color="#000099">bx</font>',$cnx_id,'<font color="#000099">SELECT txt FROM t_info ORDER BY txt</font>')</span></div>
  <br>
  <div class="title-1b"> Empty secondary block:</div>
  You can specify a special secondary block that will be used to replace unused secondary blocks (without records). This &quot;Empty&quot; secondary block must have the index 0. It can either be placed inside the main block with the normal secondary block, or alone inside another <span class="opt-name">serial</span> block. The &quot;empty&quot; secondary block is optional.<br>
  <br>
  <div class="decal">Example:<br>
    <br>
    <table width="200" cellpadding="4" cellspacing="0" class="border-2">
      <tr>
        <td class="border-2"><table width="100%" cellpadding="2" cellspacing="0" class="border-1">
            <tr>
              <td width="25%" class="border-1"><div align="center">[bx;block=tr;serial][bx_1.txt;block=td]</div></td>
              <td width="25%" class="border-1"><div align="center">[bx_2.txt;block=td]</div></td>
              <td width="25%" class="border-1"><div align="center">[bx_3.txt;block=td]</div></td>
              <td width="25%" class="border-1"><div align="center">[bx_4.txt;block=td]</div></td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td class="border-2"><table width="100%" cellpadding="2" cellspacing="0" class="border-1">
            <tr>
              <td width="25%" class="border-1"><div align="center">[bx;block=tr;serial][bx_0;block=td] <strong>No records found. </strong></div></td>
              <td width="25%" class="border-1">&nbsp;</td>
              <td width="25%" class="border-1">&nbsp;</td>
              <td width="25%" class="border-1">&nbsp;</td>
            </tr>
          </table></td>
      </tr>
    </table>
  </div>
  <br>
  Remark:<br>
  The serial display also works with <a href="#html_block_section">sections of block</a> and <a href="#html_block_subblock">dynamic queries</a>.</div>
<div class="title-2"><a name="html_block_subblock" id="html_block_subblock"></a>Subblocks:</div>
<div class="norm"> A subblock is a TBS block nested into another TBS block and that  should be displayed as a separated block for each record of its parent block. <br>
  <div class="decal"> Example:<br>
    <br>
    <table cellpadding="2" cellspacing="0" class="border-2">
      <tr>
        <td class="border-2">Parent block record #1<br>
          <div class="decal">
            <table cellpadding="1" cellspacing="0" class="border-1">
              <tr>
                <td class="border-1">Subblock record #1.1</td>
              </tr>
              <tr>
                <td class="border-1">Subblock record #1.2</td>
              </tr>
            </table>
          </div></td>
      </tr>
      <tr>
        <td class="border-2">Parent block record #2<br>
          <div class="decal">
            <table cellpadding="1" cellspacing="0" class="border-1">
              <tr>
                <td class="border-1">Subblock record #2.1</td>
              </tr>
              <tr>
                <td class="border-1">Subblock record #2.2</td>
              </tr>
              <tr>
                <td class="border-1">Subblock record #2.3</td>
              </tr>
            </table>
          </div></td>
      </tr>
      <tr>
        <td class="border-2">Parent block record #3<br>
          <div class="decal">
            <table cellpadding="1" cellspacing="0" class="border-1">
              <tr>
                <td class="border-1">Subblock record #3.1</td>
              </tr>
            </table>
          </div></td>
      </tr>
    </table>
  </div>
  <br>
  They are two different  ways to perform subblocks with TBS:<br>
  <br>
  - Automatic subblock: (<span class="versioning">since TBS 3.5.0</span>) it is when the data of the parent block has a column which contains the ready-to-merge data for the subblock. Automatic subblocks are activated using parameter <span class="opt-name">sub1</span> in the parent block, and they are merged automatically during the merge of the parent block. No extra MergeBlock() are needed.<br>
  See <a href="#html_block_subauto">Automatic subblocks</a> for more details.<br>
  <br>
  - Subblock with dynamic query: it is when the data of the subblocks are retrieved using a query which can change for each record of the parent block. Subblocks with dynamic queries need an extra MergeBlock() to perform the merging with their dynamic query. Parameter <span class="opt-name">p1</span> is also needed in the subblock definition in order to set the values to inject in the dynamic query.<br>
  See <a href="#html_block_dynsb">Subblocks with dynamic queries</a> for more details. <br>
</div>
<div class="title-2"><a name="html_block_subauto" id="html_block_subauto"></a>Automatic subblocks:</div>
<div class="norm"><span class="versioning">Automatic subblock are supported since TBS version 3.5.0.</span><br>
  <br>
  You can use automatic subblocks when the data of the parent block has a column which contains the ready-to-merge subdata for the subblock.  
  Set parameter <span class="opt-name">sub1</span>=<span class="opt-value">colum</span> in the parent block to define the column which contain the data for the subblock. If you have several subblocks to merge in the same parent block then  use parameters <span class="opt-name">sub2</span>, <span class="opt-name">sub3</span>, ... The name of the subblock must be the same as the parent block followed by the suffix <span class="opt-name">_sub1</span>, (or <span class="opt-name">_sub2</span>, <span class="opt-name">_sub3</span>, ...)<br>
  <br>
  The data of the parent block must have a column which contains the data of the subblock. Supported data types are:<br>
  - a PHP array<br>
  - an object supported by TBS (natively or with a plug-in) <br>
  - a text string  of values separated  by comas (,).<br>
  <br>
  <div class="decal">Example:<br>
    <br>
    <table width="400" cellpadding="2" cellspacing="0" class="border-2">
      <tr>
        <td class="border-2"><font color="#336699">Name:</font> [body.name;block=tr;sub1=spokenlg]<br>
          <table cellpadding="1" cellspacing="0" class="border-1">
            <tr>
              <td width="200" class="border-1">[body_sub1.val;block=tr]</td>
            </tr>
          </table></td>
      </tr>
    </table>
    <br>
    <span class="txt-small">Corresponding PHP code:</span><br>
    <span class="txt-code">&nbsp;$TBS-&gt;MergeBlock('<span class="opt-value">body</span>',$cnx_id,'<span class="opt-value">SELECT name,spokenlg FROM t_body</span>)</span><br>
    <br>
    <span class="txt-small">Result of the merge:</span><br>
    <br>
    <table width="400" cellpadding="2" cellspacing="0" class="border-2">
      <tr>
        <td class="border-2"><font color="#336699">Name:</font> Peter<br>
          <table cellpadding="1" cellspacing="0" class="border-1">
            <tr>
              <td class="border-1">US</td>
            </tr>
            <tr>
              <td width="190" class="border-1">FR</td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td class="border-2"><font color="#336699">Name:</font> Paul<br>
          <table cellpadding="1" cellspacing="0" class="border-1">
            <tr>
              <td width="190" class="border-1">US</td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td class="border-2"><font color="#336699">Name: </font>Jack<br>
          <table cellpadding="1" cellspacing="0" class="border-1">
            <tr>
              <td class="border-1">FR</td>
            </tr>
            <tr>
              <td class="border-1">ES</td>
            </tr>
            <tr>
              <td width="190" class="border-1">IT</td>
            </tr>
          </table></td>
      </tr>
    </table>
  </div>
</div>
<div class="title-2"><a name="html_block_dynsb" id="html_block_dynsb"></a>Subblocks with dynamic queries:</div>
<div class="norm"><br>
  <div class="title-1b">Principles of the dynamic queries:</div>
  <br>
  It is possible to use the MergeBlock() method with a dynamic query.<br>
  In your template, you have to define a block by adding the parameters <span class="opt-name">p1</span>, <span class="opt-name">p2</span>, <span class="opt-name">p3</span>,... with their values.<br>
  The query given to the MergeBlock() method has to contain marks such as <span class="opt-value">%p1%</span>, <span class="opt-value">%p2%</span>, <span class="opt-value">%p3%</span>, ... in order to welcome the values of the parameters <span class="opt-name">p1</span>, <span class="opt-name">p2</span>, <span class="opt-name">p3</span>,... <br>
  <br>
  Each section of the block to be merged that contains a parameter <span class="opt-name">p1</span> will be computed as a separate block for which the dynamic query is re-executed. The sections of the block that have no parameter <span class="opt-name">p1</span> are combined with the previous section with a parameter <span class="opt-name">p1</span>.<br>
  <br>
  <div class="decal">Example:<br>
    <br>
    Country: France <br>
    <table cellpadding="2" cellspacing="0" class="border-1">
      <tr>
        <td width="200" class="border-1">[blk.town;block=tr;p1='france']</td>
        <td width="100" class="border-1">[blk.country]</td>
      </tr>
    </table>
    <br>
    Country: USA <br>
    <table cellpadding="2" cellspacing="0" class="border-1">
      <tr>
        <td width="200" class="border-1">[blk.town;block=tr;p1='us']</td>
        <td width="100" class="border-1">[blk.country]</td>
      </tr>
    </table>
    <br>
    <span class="txt-small">Corresponding PHP code:</span><br>
    <span class="txt-code">&nbsp;$TBS-&gt;MergeBlock('<span class="opt-value">blk</span>',$cnx_id,&quot;<span class="opt-value">SELECT town,country FROM t_geo WHERE (country='%p1%')</span>&quot;)<br>
    <br>
    </span><span class="txt-small">Result of the merge:<br>
    </span><br>
    Country: France <br>
    <table cellpadding="2" cellspacing="0" class="border-1">
      <tr>
        <td width="200" class="border-1">Paris</td>
        <td width="100" class="border-1">france</td>
      </tr>
      <tr>
        <td class="border-1">Toulouse</td>
        <td class="border-1">france</td>
      </tr>
    </table>
    <br>
    Country: USA<br>
    <table cellpadding="2" cellspacing="0" class="border-1">
      <tr>
        <td width="200" class="border-1">Washington</td>
        <td width="100" class="border-1">us</td>
      </tr>
      <tr>
        <td class="border-1">Boston</td>
        <td class="border-1">us</td>
      </tr>
    </table>
  </div>
  <br>
  <div class="title-1b">Use with subblocks:</div>
  <br>
  Dynamic queries enable you to easily build a system of a main-block with subblocks. Here is how you can do it:<br>
  - Create a main block, and then a subblock inside the main block.<br>
  - Link them by adding to the subblock a parameter <span class="opt-name">p1</span> whose value is a field from the main block.<br>
  - At the PHP side, merge the main block first, and then the subblock.<br>
  <br>
  <div class="decal">Example:<br>
    <br>
    <table width="400" cellpadding="2" cellspacing="0" class="border-2">
      <tr>
        <td class="border-2"><font color="#336699">Country:</font> [main.country;block=tr]<br>
          <table cellpadding="1" cellspacing="0" class="border-1">
            <tr>
              <td width="200" class="border-1">[sub.town;block=tr;p1=[main.cntr_id]]</td>
            </tr>
          </table></td>
      </tr>
    </table>
    <br>
    <span class="txt-small">Corresponding PHP code:</span><br>
    <span class="txt-code">&nbsp;$TBS-&gt;MergeBlock('<span class="opt-value">main</span>',$cnx_id,'<span class="opt-value">SELECT country,cntr_id FROM t_country</span>')</span><br>
    <span class="txt-code">&nbsp;$TBS-&gt;MergeBlock('<span class="opt-value">sub</span>',$cnx_id,'<span class="opt-value">SELECT town FROM t_town WHERE (cntr_id=%p1%)</span>') </span><br>
    <br>
    <span class="txt-small">Result of the merge:</span><br>
    <br>
    <table width="400" cellpadding="2" cellspacing="0" class="border-2">
      <tr>
        <td class="border-2"><font color="#336699">Country:</font> France<br>
          <table cellpadding="1" cellspacing="0" class="border-1">
            <tr>
              <td class="border-1">Paris</td>
            </tr>
            <tr>
              <td width="190" class="border-1">Toulouse</td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td class="border-2"><font color="#336699">Country:</font> Germany<br>
          <table cellpadding="1" cellspacing="0" class="border-1">
            <tr>
              <td class="border-1">Berlin</td>
            </tr>
            <tr>
              <td width="190" class="border-1">Munich</td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td class="border-2"><font color="#336699">Country: </font>Spain<br>
          <table cellpadding="1" cellspacing="0" class="border-1">
            <tr>
              <td class="border-1">Madrid</td>
            </tr>
            <tr>
              <td width="190" class="border-1">Barcelona</td>
            </tr>
          </table></td>
      </tr>
    </table>
  </div>
  <br>
  Remarks:<br>
  - The parameter <span class="opt-name">htmlconv</span>=<span class="opt-value">esc</span> enables you to pass protected string values to the query.<br>
  - The dynamic queries also work with <a href="#html_block_section">sections of block</a> and <a href="#html_block_serial">serial display</a>.</div>
<div class="title-2"><a name="html_block_auto" id="html_block_auto"></a>Automatic blocks:</div>
<div class="norm">Automatic blocks enable you  to automatically merge conditional blocks when some events occur<a href="#php_mergeblock"></a>. <br>
  <br>
  There are two types of automatic blocks:<br>
  - <span class="opt-name">[onload]</span> blocks which are merged automatically when the <a href="#php_loadtemplate">LoadTemplate()</a> method is called.<br>
  - <span class="opt-name">[onshow]</span> blocks which are merged automatically when the <a href="#php_show">Show()</a><a href="#php_loadtemplate"></a> method is called.<br>
  <br>
  Automatic blocks</a> are not merged with data ; that's why they cannot have normal sections (non conditional sections) and linked fields. Automatic blocks can have only conditional sections. Conditions are evaluated only once, and they <span class="opt-name"></span> be  expressions containing [var] fields.<br>
  <br>
  <div class="decal">Example:<br>
    <br>
    <table width="460" cellpadding="2" cellspacing="0" class="border-1">
      <tr>
        <td class="border-1">[<span class="opt-name">onload</span>;<span class="opt-name">block</span>=tr;<span class="opt-name">when</span> [<span class="opt-name">var.</span>light]=<span class="opt-value">1</span>]<span class="opt-html">Light is ON.</span></td>
      </tr>
    </table>
    <br>
    <table width="460" cellpadding="2" cellspacing="0" class="border-1">
      <tr>
        <td class="border-1">[<span class="opt-name">onshow</span>;<span class="opt-name">block</span>=tr;<span class="opt-name">when</span> [<span class="opt-name">var.</span>user]=<span class="opt-value">1</span>]<span class="opt-html"> User : [onshow.username]</span></td>
      </tr>
    </table>
  </div>
  <br>
  If you need to have a group of exclusive  sections, with or without a default section, you can suffix the [onload] and [onshow] bloc's names with  &quot;_&quot; followed by a sub name.<br>
  <br>
  <br>
  <div class="decal">Example:<br>
    <br>
    <table width="400" cellpadding="2" cellspacing="0" class="border-1">
      <tr>
        <td class="border-1">[<span class="opt-name">onload_ligth</span>;<span class="opt-name">block</span>=tr;<span class="opt-name">when</span> [<span class="opt-name">var.</span>light]=<span class="opt-value">1</span>]<span class="opt-html"> Light is ON.</span></td>
      </tr>
      <tr>
        <td class="border-1">[<span class="opt-name">onload_ligth</span>;<span class="opt-name">block</span>=tr;<span class="opt-name">when</span> [<span class="opt-name">var.</span>light]=<span class="opt-value">0</span>]<span class="opt-html"> Light is OFF.</span></td>
      </tr>
      <tr>
        <td class="border-1">[<span class="opt-name">onload_ligth</span>;<span class="opt-name">block</span>=tr;<span class="opt-name">default</span>] <span class="opt-html">Light is ?</span></td>
      </tr>
    </table>
  </div>
  <br>
  See <a href="#html_conditional_section">Conditional sections</a> for more details.<br>
</div>
<div class="title-2"><a name="html_subtemplate" id="html_subtemplate"></a>Subtemplates:</div>
<div class="norm">There are two ways to insert subtemplates in your main template.<br>
  <br>
  <span class="title-1c">Primary insertion using parameter <span class="opt-name">file</span>:</span><br>
  <br>
  This is the best way to simply insert a part  contained in another file, like usually done for headers and footers. <br>
  <br>
  The value given to parameter <span class="opt-name">file</span> must be the name of a file existing on the server. You can use an expression with [var] Fields and the [val] keyword which represent the value of the field. If the value is an empty string, then no error message is displayed, it is like parameter <span class="opt-name">file</span> is ignored. This can be used to manage conditional insertion. <br>
  <br>
  <span class="title-1b">Examples:</span><br>
  <div class="decal">[<span class="opt-name">onload</span>;<span class="opt-name">file</span>=header.htm]<br>
    [<span class="opt-name">onload</span>;<span class="opt-name">file</span>=[<span class="opt-name">var</span>.file_header]]<br>
    [<span class="opt-name">onload</span>.sub1;<span class="opt-name">file</span>=[<span class="opt-name">val</span>]]<br>
    [<span class="opt-name">onload</span>;<span class="opt-name">file</span>=[<span class="opt-name">var</span>.<span class="opt-name">insert</span>;if [<span class="opt-name">val</span>]=1;<span class="opt-name">then</span> <span class="opt-value">'header.html'</span>;<span class="opt-name">else</span> <span class="opt-value">''</span>]]</div>
  <br>
  Contents of the file is inserted at the place of the field, without no <a href="#html_field_prm_htmlconv">char conversion</a> and no <a href="#html_field_prm_protect">TBS protection</a>.<br>
  [onload] tags contained in the file are  processed at the insertion. 
  [onshow] tags will be merged on the Show() method because they became part of the main template.<br>
  <br>
  The subtemplate can contain any TBS fields, including [var] fields and blocks to be merged. If you intend to merge data with a block defined into a subtemplate, then it's suggested to use parameter <span class="opt-name">file</span> in  an [onload] field in order to ensure that the subtemplate is inserted before you call MergeBlock(). <br>
  <br>
  You can create a subtemplate in an independent XML/HTML/Text file, and ask TBS to include in the main template only the <span class="opt-html">&lt;body&gt;</span> part (or another part). This can be done by adding parameter <a href="#html_field_prm_getbody" class="opt-name">getbody</a> to parameter <span class="opt-name">file</span> in the TBS field of the main template. This technique enables you to work <span class="contextual" title="What You See Is What You Get">WYSIWYG</span> with your subtemplates.<br>
  <br>
  <br>
  <div id="v202_subtpl_overview"> <span class="title-1c">Insertion driven with Php code using parameter <span class="opt-name">subtpl</span>:</span><br>
    <br>
    Parameter <span class="opt-name">subtpl</span> is useful to manage subtemplate insertion with Php code. Parameter <span class="opt-name">subtpl</span> is active  only when used with a parameter<span class="opt-name"> script</span> or <span class="opt-name">onformat.</span> It turns the current TBS instance in  Subtemplate mode during the script or function execution and can act on a new template without deteriorating the main template.<br>
    <br>
    The Subtemplate mode presents the following characteristics:<br>
    <br>
    <table width="100%" border="0" cellpadding="2" cellspacing="0" >
      <tr>
        <td valign="top">*</td>
        <td>Php outputs are displayed at the field's place instead of being immediately sent to the client. 
          For example, using the Php command echo()  will insert a text in the main template instead of be directly output it. Using the Show() method will also insert the result of the sub-merge into the main template. </td>
      </tr>
      <tr>
        <td valign="top">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="10" valign="top">*</td>
        <td>A reference to the TBS instance is provided by  local variable <span class="opt-name">$this</span> or <span class="opt-name">$TBS</span>, whether you use parameter <span class="opt-name">script</span> or <span class="opt-name">onformat</span>. This variable be used for new submerges without deteriorating the main template. The Show() method won't stop any script execution during the Subtemplate mode like it does by default in normal mode.</td>
      </tr>
    </table>
    <br>
    When the script or the function ends, the TBS instance returns in normal mode with the main TBS template.<br>
    <br>
    Example <span class="txt-small">with parameter <span class="opt-name">script</span>:</span><br>
    <br>
    <div class="decal">
      <table width="100%" border="0" cellpadding="4" cellspacing="0" >
        <tr>
          <td width="120" valign="top" class="title-1b">HTML:</td>
          <td>[<span class="opt-name">onload</span>.file;<span class="opt-name">script</span>=<span class="opt-value">specialbox.php</span>;<span class="opt-name">subtpl</span>]</td>
        </tr>
        <tr>
          <td valign="top" class="title-1b">PHP script:</td>
          <td class="txt-code"><span class="opt-html">&lt;?php</span><br>
            &nbsp;&nbsp;echo(<span class="opt-value">'* Here include a subtemplate *'</span>);<br>
            &nbsp;&nbsp;<span class="opt-name">$this</span>-&gt;LoadTemplate(<span class="opt-name">$CurrVal</span>);<br>
            &nbsp;&nbsp;<span class="opt-name">$this</span>-&gt;MergeBlock(<span class="opt-value">'blk1'</span>,<span class="opt-name">$GLOBALS</span>[<span class="opt-value">'conn_id'</span>],<span class="opt-value">'SELECT * FROM table1'</span>);<br>
            &nbsp;&nbsp;<span class="opt-name">$this</span>-&gt;Show(); <br>
            <span class="opt-html">?&gt;</span></td>
        </tr>
        <tr>
          <td valign="top" class="title-1b">Remarks:</td>
          <td class="txt-small"><span class="opt-name">$CurrVal</span> is a local variable provided by TBS when using parameter <span class="opt-name">script</span> ; this variable  is a reference to the value of the field currently merged. In the example above, <span class="opt-name">$CurrVal</span> has the value of the global variable <span class="opt-name">$file</span>. You can replace it, for example, by the name of the subtemplate to load (for example: <span class="opt-value">'mysubtpl.htm'</span>). See parameter <a href="#html_field_prm_script" class="opt-name">script</a> for more information. </td>
        </tr>
      </table>
      <span class="txt-code"></span></div>
    <br>
    Example <span class="txt-small">with parameter <span class="opt-name">onformat</span>:</span><br>
    <br>
    <div class="decal">
      <table width="100%" border="0" cellpadding="4" cellspacing="0" >
        <tr>
          <td width="120" valign="top" class="title-1b">HTML:</td>
          <td>[<span class="opt-name">onload</span>.user_mode;<span class="opt-name">onformat</span>=<span class="opt-value">f_user_info</span>;<span class="opt-name">subtpl</span>]</td>
        </tr>
        <tr>
          <td valign="top" class="title-1b">PHP user function:</td>
          <td class="txt-code">function f_user_info(<span class="opt-name">$FieldName</span>,&amp;<span class="opt-name">$CurrVal</span>,&amp;<span class="opt-name">$CurrPrm</span>,&amp;<span class="opt-name">$TBS</span>) {<br>
            &nbsp;&nbsp;if ($CurrVal==1) { <span class="opt-html">// User is logged in </span> <br>
            &nbsp;&nbsp;&nbsp;&nbsp;<span class="opt-name">$TBS</span>-&gt;LoadTemplate(<span class="opt-value">'user_info.htm'</span>);<br>
            &nbsp;&nbsp;&nbsp;&nbsp;<span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-value">'blk1'</span>,<span class="opt-name">$GLOBALS</span>[<span class="opt-value">'conn_id'</span>],<span class="opt-value">'SELECT * FROM table1'</span>);<br>
            &nbsp;&nbsp;&nbsp;&nbsp;<span class="opt-name">$TBS</span>-&gt;Show();<br>
            &nbsp;&nbsp;} else { <span class="opt-html">// User not logged in</span><br>
            &nbsp;&nbsp;&nbsp;&nbsp;echo(<span class="opt-value">'You are not logged in.'</span>); <br>
            &nbsp;&nbsp;}<br>
            }</td>
        </tr>
        <tr>
          <td valign="top" class="title-1b">Remarks:</td>
          <td><span class="txt-small"><span class="opt-name">$CurrVal</span> is a variable declared as an argument of the function. It's TBS that is in charge to call this function making <span class="opt-name">$CurrVal</span> referring to the value of the fields currently merged. In this example above, <span class="opt-name">$CurrVal</span> is equal to the global variable <span class="opt-name">$user_mode</span>. In the same way, variable <span class="opt-name">$CurrPrm</span> is a reference to the array of parameters of the field currently merged, and <span class="opt-name">$TBS</span> is a reference to the  TinyButStrong instance currently used. See parameter <a href="#html_field_prm_script" class="opt-name">onformat</a> for more information. </span></td>
        </tr>
      </table>
    </div>
  </div>
</div>
<div class="title-2"><a name="html_conditional" id="html_conditional"></a>Conditional display overview:</div>
<div class="norm">TinyButStrong offers several tools for conditional display for both fields and blocks.<br>
  <br>
  <span class="title-1c">Conditional fields</span><br>
  <br>
  For any TBS fields you can use parameters for conditional display, recalled below.<br>
  <div class="decal">
    <table border="0" cellpadding="2" cellspacing="0" >
      <tr class="title-1b">
        <td width="250" valign="top">Parameter</td>
        <td valign="top">Description</td>
      </tr>
      <tr>
        <td valign="top">. (dot) </td>
        <td valign="top">Display an Html unbreakable space if the field value is empty.</td>
      </tr>
      <tr>
        <td valign="top"><span class="opt-name">ifempty</span>=<span class="opt-value">value2</span></td>
        <td valign="top">Display <span class="opt-value">value2</span> if the field value is empty.</td>
      </tr>
      <tr>
        <td valign="top"><span class="opt-name">magnet</span>=<span class="opt-value">tag</span></td>
        <td valign="top">Delete a tag or a pair of tags if the field value is empty.</td>
      </tr>
      <tr>
        <td valign="top"><span class="opt-name">if</span> <span class="opt-value">condition</span><br>
          <span class="opt-name">then</span> <span class="opt-value">value1</span><br>
          <span class="opt-name">else</span> <span class="opt-value">value2</span></td>
        <td valign="top">Display <span class="opt-value">value1</span> or <span class="opt-value">value2</span> depending on whether the condition is verified or not.</td>
      </tr>
      <tr>
        <td valign="top"><span class="opt-name">frm</span>=<span class="opt-value">format1</span>|<span class="opt-value">format2</span>|<span class="opt-value">format3</span>|<span class="opt-value">format4</span></td>
        <td valign="top">Changes the numeric format or date/time format depending on whether the value is positive, negative, zero or empty. </td>
      </tr>
    </table>
  </div>
  <br>
  <div class="decal">Example:<br>
    [<span class="opt-name">onshow.error_id</span>;<span class="opt-name">if</span> <span class="opt-value">[val]=0</span>;<span class="opt-name">then</span> <span class="opt-value">'no error'</span>;<span class="opt-name">else</span> <span class="opt-value">'error found'</span>] </div>
  <br>
  <span class="title-1c"><a name="html_conditional_section"></a>Conditional sections</span> <br>
  <br>
  You can use conditional sections any TBS block (<a href="#html_block">data block</a> or <a href="#html_block_auto">automatic block</a>). A conditional section is a  section which has a parameter <span class="opt-name">when</span> defining a condition, or parameter <span class="opt-name">default</span>. At the block's merging, each <span class="opt-name">when</span> condition of conditional sections is evaluated until one is verified. As soon as one <span class="opt-name">when</span> condition is verified, its conditional section is kept and other conditional sections are deleted. If no <span class="opt-name">when</span> condition is verified, then the <span class="opt-name">default</span> section is displayed if it exists. <br>
  <br>
  <span class="title-1b">The case of data blocks:</span><br>
  If it is a data block, it means a block merged with <a href="#php_mergeblock">MergeBlock()</a>, then the conditional sections are reassessed for each record. It is even possible to  define a data block with only conditional sections, with no standard section.<br>
  <br>
  <span class="title-1b">Defining the conditions:</span><br>
  The conditions defined into parameters <span class="opt-name">when</span> can be expressions that contain <a href="#html_field_auto">[var] fields</a> et and linked fields (if it is  a data block). See <a href="#html_block_prm_when">parameter when</a> for more details about operators supported by TBS.<br>
  <br>
  <span class="title-1b">Section exclusivity: </span><br>
  By default conditional sections are exclusive inside a block. It means only one conditional section of a block can be displayed. But if you want a block to have non-exclusive conditional sections, you can use parameter <span class="opt-name">several</span> on the first conditional section. With this parameter, all conditions are evaluated and each true condition makes its section to be displayed.<br>
  <br>
  Example with a <a href="#html_block">data block</a>: <br>
  <br>
  <div class="decal">
    <table width="600" cellpadding="2" cellspacing="0" class="border-1">
      <tr>
        <td class="border-1"><span class="opt-html">Name: </span>[<span class="opt-name">b1</span>.Name;<span class="opt-name">block</span>=tr]</td>
        <td valign="top" class="opt-html">standard section</td>
      </tr>
      <tr>
        <td class="border-1"><span class="opt-html">Address:</span><br>
          [<span class="opt-name">b1</span>.add_line1;<span class="opt-name">block</span>=tr;<span class="opt-name">when</span> [<span class="opt-name">b1.</span>address]=<span class="opt-value">1</span>]<br>
          [<span class="opt-name">b1</span>.add_line2]<br>
          [<span class="opt-name">b1</span>.add_zip] - [<span class="opt-name">b1</span>.add_town]<br></td>
        <td valign="top" class="opt-html">conditional section</td>
      </tr>
      <tr>
        <td class="border-1"><span class="opt-html">No address.</span>[<span class="opt-name">b1</span>;<span class="opt-name">block</span>=tr;<span class="opt-name">default</span><span class="opt-value"></span>]</td>
        <td valign="top" class="opt-html">default conditional section (optional)</td>
      </tr>
    </table>
  </div>
  <br>
  Example with an <a href="#html_block_auto">automatic block</a>: <br>
  <div class="decal">
    <table cellpadding="2" cellspacing="0" class="border-1">
      <tr>
        <td class="border-1">[<span class="opt-name">onload_err</span>;<span class="opt-name">block</span>=tr;<span class="opt-name">when</span> [<span class="opt-name">var.</span>email]='';<span class="opt-name">several</span>]<span class="opt-html"> Your email is empty.</span></td>
      </tr>
      <tr>
        <td class="border-1">[<span class="opt-name">onload_err</span>;<span class="opt-name">block</span>=tr;<span class="opt-name">when</span> [<span class="opt-name">var.</span>name]=<span class="opt-value">0</span>]<span class="opt-html"> Your name is empty.</span></td>
      </tr>
      <tr>
        <td class="border-1">[<span class="opt-name">onload_err</span>;<span class="opt-name">block</span>=tr;<span class="opt-name">default</span>] <span class="opt-html">All is ok.</span></td>
      </tr>
    </table>
  </div>
  <br>
</div>
<div class="title-3 pagebreak"><a name="plugins" id="plugins"></a>Coding plug-ins:</div>
You can  add features to TinyButStrong using plug-ins. The <span class="title-1c">database plug-ins</span> simply enable the method MergeBlock() to recognize new types of database. The <span class="title-1c">other plug-ins</span> enable you to add features to TBS or to modify its main methods in order to make it more specialized. <br>
<br>
In both cases, a plug-in is made of a set of PHP functions or one PHP class which have to fit with a special syntax expected by TBS. Some plug-ins are proposed for download at the <a href="http://www.tinybutstrong.com">TinyButStrong web site</a>.<br>
<br>
<div class="title-2"><a name="plugins_db" id="plugins_db"></a>Database plug-ins:</div>
<div class="norm"> <span class="versioning">Versioning: database plug-ins are supported since TBS version 1.8.</span> <br>
  <br>
  A database plug-in enables the method MergeBlock() to recognize a new type of database.<br>
  When you have a call such as <span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-name">$BlockName</span>, <span class="opt-name">$Source</span>, <span class="opt-name">$Query</span>), the MergeBlock process is first examining <span class="opt-name">$Source</span> to see if its type is supported. <br>
  <table border="0" cellspacing="0" cellpadding="3">
    <tr>
      <td valign="top">&bull;</td>
      <td valign="top">If <span class="opt-name">$Source</span> is a type of resource known  in native by TBS, then the MergeBlock process doesn't need any plug-in help, it will retrieve  the data by its own. </td>
    </tr>
    <tr>
      <td valign="top">&bull;</td>
      <td valign="top">If <span class="opt-name">$Source</span> is an object  having a method named tbsdb_open() then the MergeBlock process  assumes that  the object  is a database plug-in and use it to retrieve the data. (See more details below)</td>
    </tr>
    <tr>
      <td valign="top">&bull;</td>
      <td valign="top">If <span class="opt-name">$Source</span> is a string beginning  with <span class="opt-value">'~'</span> then the MergeBlock process  assumes that  property <span class="opt-name">$TBS</span>-&gt;ObjectRef is a database plug-in and use it to retrieve the data. (See more details below)</td>
    </tr>
    <tr>
      <td valign="top">&bull;</td>
      <td valign="top">If <span class="opt-name">$Source</span> is something else then the MergeBlock process  is trying to found the plug-in made by user functions that correspond to the type of <span class="opt-name">$Source</span>. (See more details below)</td>
    </tr>
  </table>
  <br>
  <span class="title-1c">Database plug-in based un user functions: </span> <br>
  <br>
  When the MergeBlock process meet a type of value for <span class="opt-name">$Source</span> which is not supported in native, it determines the TBS Id corresponding to that type. Then it looks for the user functions corresponding to that TBS Id.<br>
  <br>
  <span class="title-1b">How to determine the TBS Id:</span><br>
  The TBS Id is a string identifier determined  by the argument <span class="opt-name">$Source</span>.<br>
  If <span class="opt-name">$Source</span> is a string =&gt; the TBS Id is that string.<br>
  If <span class="opt-name">$Source</span> is a PHP resource =&gt; the TBS Id is the name of the  resource's type.<br>
  If <span class="opt-name">$Source</span> is an object =&gt; the TBS Id is the name of the class.<br>
  For some convenience, if the TBS Id contains spaces (' '), it is cut. If the TBS Id contains '-', they are replaced with '_'.<br>
  For example, a PHP variable for a Sybase connection is typed as Resource and its resource name is <span class="opt-value">'sybase-db link'</span>. The corresponding TBS Id is <span class="opt-value">'sybase_db'</span>.<br>
  <br>
  <span class="title-1b">How to build the plug-in for a TBS Id:</span><br>
  The plug-in is made of 3 user functions which must have specific names.<br>
  The following function names are made for a TBS Id which is <span class="opt-value">'tbsid'</span>. For another TBS Id, you just have to rename the functions.<br>
  You can found several examples of database plug-in at the <a href="http://www.tinybutstrong.com/plugins.php#plugin_db">TinyButStrong web site</a>.<br>
  <br>
  Synopsis:<br>
  <br>
  function <span class="tbsname">tbsdb_tbsid_open</span>(&amp;<span class="opt-name">$Source</span>, &amp;<span class="opt-name">$Query</span>)<br>
  <div class="decal">This function is  called one time by the MergeBlock process, before the other user functions. <br>
    It is supposed to  	use <span class="opt-name">$Source</span> and <span class="opt-name">$Query</span> to open a recordset, and return a reference of that recordset.<br>
  </div>
  function <span class="tbsname">tbsdb_tbsid_fetch</span>(&amp;<span class="opt-name">$Rs</span> [,<span class="opt-name">$RecNum</span>])<br>
  <div class="decal">This function is  called several times by the MergeBlock process, as many times as there are data to fetch from the query. <br>
    This function should return the next record as an associative array (column name=&gt; value), or return <span class="opt-value">false</span> if there is no record left.<br>
    <span class="opt-name">$Rs</span> is the value provided by <span class="tbsname">tbsdb_tbsid_open</span>(). It is commonly  a recordset's reference.<br>
    <span class="opt-name">$RecNum</span> can be useful for some database type such as Oracle, for which the number of the record is needed to retrieve it. </div>
  function <span class="tbsname">tbsdb_tbsid_close</span>(&amp;<span class="opt-name">$Rs</span>)<br>
  <div class="decal">This function is  called on time by the MergeBlock process, after the other user functions. <br>
    This function should close the recordset properly. <br>
    <span class="opt-name">$Rs</span> is the value provided by <span class="tbsname">tbsdb_tbsid_open</span>(). It is commonly  a recordset's reference.</div>
  <br>
  <br>
  <span class="title-1c">Database plug-in based on  object:</span> <br>
  <br>
  When the MergeBlock process meet of value for <span class="opt-name">$Source</span> which is an object, and if that object has a method named <span class="tbsname">tbsdb_open()</span>, then it assumes that the object is a database plug-in. <br>
  The object must have at least the 3 methods <span class="tbsname">tbsdb_open()</span>, <span class="tbsname">tbsdb_fetch()</span> and <span class="tbsname">tbsdb_close()</span>. There can be other methods and properties, but those 3 methods must have the same syntax and the same feature as the user functions described above.<br>
  <br>
  Synopsis:<br>
  <br>
  class clsTbsPlugin {<br>
  &nbsp;&nbsp;function tbsdb_open(&amp;<span class="opt-name">$Source</span>, &amp;<span class="opt-name">$Query</span>)<br>
  &nbsp;&nbsp;function tbsdb_fetch(&amp;<span class="opt-name">$Rs</span> [,<span class="opt-name">$RecNum</span>])<br>
  &nbsp;&nbsp;function tbsdb_close(&amp;<span class="opt-name">$Rs</span>)<br>
  }<br>
  <br>
  <br>
  <span class="title-1c">Database plug-in based on property ObjectRef:<br>
  </span><br>
  When the MergeBlock process meet a value for <span class="opt-name">$Source</span> which is a string beginning with '~' then it assumes that   property <span class="opt-name">$TBS-</span>&gt;ObjectRef is a database plug-in based on  object (see <a href="#php_oop">OOP</a>). The object must have the same requirements  as a database plug-in based on objet described above, but the names of the methods can be different.<br>
  <br>
  Example: <br>
  <span class="opt-name">$TBS</span>-&gt;MergeBlock(<span class="opt-name">$BlockName</span>,<span class="opt-value">'~dbkey'</span>,<span class="opt-name">$Query</span>);<br>
  <br>
  class clsTbsPlugin {<br>
  &nbsp;&nbsp;function dbkey_open(&amp;<span class="opt-name">$Source</span>, &amp;<span class="opt-name">$Query</span>)<br>
  &nbsp;&nbsp;function dbkey_fetch(&amp;<span class="opt-name">$Rs</span> [,<span class="opt-name">$RecNum</span>])<br>
  &nbsp;&nbsp;function dbkey_close(&amp;<span class="opt-name">$Rs</span>)<br>
  }<br>
  <br>
</div>
<div class="title-2"><a name="plugins_tbs" id="plugins_tbs"></a>Other plug-ins:</div>
<div class="norm"><span class="zone-normal"><span class="versioning">Versioning:  plug-ins are supported since TBS version 3.0.</span><br>
  <br>
  <span class="title-1c">Coding a plug-in using a PHP class:</span><br>
  <br>
  <span class="title-1b">&bull; Plug-in's key:</span><br>
  <br>
  Each plug-in has a plug-in key which is  the name of its Php class. This key must be given to the method <a href="#php_plugin">PlugIn()</a> when you use it. Thus, it is recommended to  define a PHP constant for the plug-in's key (see example below).<br>
  <br>
  </span><span class="title-1b"><span class="zone-normal">&bull; </span>Plug-in events:</span><span class="zone-normal"><br>
  <br>
  A TBS plug-in must be a PHP class which contains one or several specific methods that will be recognized and plugged by TBS. Those specific methods are called plug-in events because they are executed automatically  by TBS when the corresponding event occurs. A TBS plug-in can also have other methods and properties for internal purpose. A TBS plug-in must have at least the OnInstall event.<br>
  <br>
  For example:<br>
  </span>
  <div class="decal txt-code"><span class="opt-html">// TBS plug-in XXX </span><br>
    <span class="opt-name">define</span>(<span class="opt-value">'TBS_XXX'</span>,<span class="opt-value">'clsTbsPlugIng_XXX'</span>); <span class="opt-html">// That is the plug-in's key</span> <br>
    <span class="opt-name">class</span> clsTbsPlugIng_XXX() {<br>
    &nbsp;&nbsp;<span class="opt-name">function</span> OnInstall(...) {...} <span class="opt-html">// That is the OnInstall event</span> <br>
    &nbsp;&nbsp;...<br>
    }</div>
  <span class="zone-normal"><br>
  <br>
  See the PHP file <span class="opt-html">&quot;tbs_plugin_syntaxes&quot;</span> to have all plug-in events, their usage and expected  arguments. There is also a list of supported events at the bottom of this section. <br>
  <br>
  The OnInstall event is special. It has to return an array with all activated events for the current plug-in (see  the PHP file <span class="opt-html">&quot;tbs_plugin_syntaxes&quot;</span>). The OnInstall event  is called when the plug-in is installed at the TBS instance.<br>
  This event can be  called in three situations:<br>
  - When using  method <a href="#php_plugin">PlugIn() </a>with the plug-in's key for the first time.<br>
  - 
  When using method PlugIn() with the plug-in's key and the argument TBS_INSTALL. <br>
  - When a new TBS instance is created,  if the plug-in's key has be added to the global array <span class="opt-name">$_TBS_AutoInstallPlugIns[]</span> (see file <span class="opt-html">&quot;tbs_plugin_syntaxes.php&quot;</span> for more details). <br>
  <br>
  </span><span class="title-1b">Property -&gt;TBS:</span> <br>
  <br>
  As soon as the plug-in is installed on the TBS instance, a property <span class="opt-name"><span class="txt-code">-&gt;TBS</span></span> is automatically  added to the plug-in, its value is a reference to the parent TBS instance. Remember this because this property can be very useful inside the plug-in's code. <br>
  <span class="zone-normal"><br>
  </span><span class="zone-normal"><span class="title-1c">Coding a plug-in using PHP functions: </span></span><br>
  <br>
  The plug-ins' key is a string that you choose and which will be used for naming the function. <span class="zone-normal">It is recommended to  define a PHP constant for the plug-in's key (see example below).</span><br>
  <br>
  The plug-in events are coded using functions, and they names must be the string 'tbspi_', followed by the plug-in's key, followed by '_' and the event's name. <br>
  Example:<br>
  <div class="decal txt-code"><span class="opt-name">define</span>(<span class="opt-value">'TBS_XXX'</span>,<span class="opt-value">'xxx'</span>);<br>
    <span class="opt-name">function</span> tbspi_xxx_OnInstall(...) {...}<br>
    ...</div>
  <br>
  All the rest works like for plug-in coded with a class. You must have at least the event OnInstall created, and it works the same way. <br>
  <br>
  <span class="title-1b">Remark:</span> PHP functions are often faster than methods, but they don't let you having  a -&gt;TBS property to reach the parent TBS instance.<br>
  <br>
  <span class="title-1c">List of plug-in events: </span><br>
  <table border="0" cellpadding="4" cellspacing="0" width="100%">
    <tbody>
      <tr>
        <td width="10" valign="top" class="title-1b">&nbsp;</td>
        <td width="120" class="title-1b">Plug-in Events </td>
        <td class="title-1b">Description</td>
      </tr>
      <tr>
        <td valign="top">&bull;</td>
        <td valign="top">OnInstall</td>
        <td>Executed automatically  when the plug-in is called for the first time, or when PlugIn() method is called with the specific argument for installing. </td>
      </tr>
      <tr>
        <td valign="top">&bull;</td>
        <td valign="top">OnCommand</td>
        <td>Executed when  PlugIn() method is called.    		This is a way to execute any user command specific to the plug-in. </td>
      </tr>
      <tr>
        <td valign="top" width="10">&bull;</td>
        <td valign="top">BeforeLoadTemplate<br></td>
        <td>Executed when  LoadTemplate() method is called. Can cancel TBS basic process. </td>
      </tr>
      <tr>
        <td valign="top" width="10">&bull;</td>
        <td valign="top">AfterLoadTemplate </td>
        <td>Executed at the end of LoadTemplate(). </td>
      </tr>
      <tr>
        <td valign="top">&bull;</td>
        <td valign="top">BeforeShow</td>
        <td>Executed when  Show() method is called. Can cancel TBS basic process. </td>
      </tr>
      <tr>
        <td valign="top">&bull;</td>
        <td valign="top">AfterShow</td>
        <td>Executed at the end of Show(). </td>
      </tr>
      <tr>
        <td valign="top">&bull;</td>
        <td valign="top">OnData</td>
        <td>Executed each time a record of data is retrieved for a MergeBlock() process. (similar to parameter 'ondata' but for every block) </td>
      </tr>
      <tr>
        <td valign="top">&bull;</td>
        <td valign="top">OnFormat</td>
        <td>Executed each time a fields is being merged. (similar to parameter 'onformat' but for every fields) </td>
      </tr>
      <tr>
        <td valign="top">&bull;</td>
        <td valign="top">OnOperation</td>
        <td>Executed each time parameter 'ope' is defined with an unsupported  keyword.</td>
      </tr>
      <tr>
        <td valign="top" width="10">&bull;</td>
        <td valign="top">BeforeMergeBlock</td>
        <td>Executed when    bounds of a block are founded. Can cancel TBS basic process. </td>
      </tr>
      <tr>
        <td valign="top" width="10">&bull;</td>
        <td valign="top">OnMergeSection</td>
        <td>Executed when a section is merged, and before it is added to other sections. </td>
      </tr>
      <tr>
        <td valign="top">&bull;</td>
        <td valign="top">OnMergeGroup</td>
        <td>Executed before a header, a footer or a splitter section is merged. (<span class="versioning">supported since TBS 3.3.0</span>)</td>
      </tr>
      <tr>
        <td valign="top" width="10">&bull;</td>
        <td valign="top">AfterMergeBlock</td>
        <td>Executed just before a merged block is inserted into the template. </td>
      </tr>
      <tr>
        <td valign="top">&bull;</td>
        <td valign="top">OnSpecialVar</td>
        <td>Executed when a non native Special Var Field (like [onshow..now]) is met. </td>
      </tr>
      <tr>
        <td valign="top">&bull;</td>
        <td valign="top">OnMergeField</td>
        <td>Executed on each field met when using the MergeField() method.</td>
      </tr>
    </tbody>
  </table>
  <br>
  <br>
</div>
<div class="title-3 pagebreak"><a name="summaries" id="summaries"></a>Summary:</div>
<div class="title-2"><a name="appendix_field" id="appendix_field"></a>TBS Field's parameters:</div>
<div class="norm">
  <table width="100%" border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="80" align="left" valign="top">Parameter</td>
      <td align="left" valign="top">Summary</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_htmlconv" class="opt-name">htmlconv</a></td>
      <td align="left" valign="top"><p>Char conversion Mode for the field's value.</p></td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_dot" class="opt-name">. </a>(dot)</td>
      <td align="left" valign="top">If the value is empty, then display an unbreakable space.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_ifempty" class="opt-name">ifempty</a></td>
      <td align="left" valign="top">If the value is empty, then display another value.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_att" class="opt-name">att</a></td>
      <td align="left" valign="top">Move the field into the attribute of an XML/HTML tag.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_attadd" class="opt-name">attadd</a></td>
      <td align="left" valign="top">Use with <span class="opt-name">att</span>. Indicate that the merged value must be added instead of be replacing the attribute's value.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_magnet" class="opt-name">magnet</a></td>
      <td align="left" valign="top">If the value is empty, then delete surrounding tags.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_mtype" class="opt-name">mtype</a></td>
      <td align="left" valign="top">Use with <a href="#html_field_prm_magnet" class="opt-name">magnet</a>.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_if" class="opt-name">if</a></td>
      <td align="left" valign="top">If the condition is verified, then change the value.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_then" class="opt-name">then</a></td>
      <td align="left" valign="top">Use with <span class="opt-name">if</span>.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_else" class="opt-name">else</a></td>
      <td align="left" valign="top">Use with <span class="opt-name">if</span>.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_onformat" class="opt-name">onformat</a></td>
      <td align="left" valign="top">Executes a Php user function to modify the field merging.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_frm" class="opt-name">frm</a></td>
      <td align="left" valign="top">Apply a date-time or a numeric format.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_tplfrms" class="opt-name">tplfrms</a></td>
      <td align="left" valign="top">Use with <span class="opt-name">onload </span>fields only. Define template formats.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_tplvars" class="opt-name">tplvars</a></td>
      <td align="left" valign="top">Use with <span class="opt-name">onload </span>fields only. Define template variables.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_protect" class="opt-name">protect</a></td>
      <td align="left" valign="top">Protection mode for characters '['.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_comm" class="opt-name">comm</a></td>
      <td align="left" valign="top">Extends the field's bounds up to the Commentary tag that surround it.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_noerr" class="opt-name">noerr</a></td>
      <td align="left" valign="top">Avoid some TBS error messages.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_file" class="opt-name">file</a></td>
      <td align="left" valign="top">Includes the contents of the file.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_script" class="opt-name">script</a></td>
      <td align="left" valign="top">Executes the Php script.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_getbody" class="opt-name">getbody</a></td>
      <td align="left" valign="top">Use with <span class="opt-name">file</span> or <span class="opt-name">script</span>. Insert only a part of the subtemplate. </td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_rename" class="opt-name">rename</a></td>
      <td align="left" valign="top">Use with <span class="opt-name">file</span> or <span class="opt-name">script</span>. Rename TBS block and fields in a subtemplate. </td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_subtpl" class="opt-name">subtpl</a></td>
      <td align="left" valign="top">Use with <span class="opt-name">script</span> or <span class="opt-name">onformat</span>. Turns the TBS instance into subtemplate mode. </td>
    </tr>
  </table>
</div>
<div class="title-2"><a name="appendix_block" id="appendix_block"></a>TBS Block's parameters:</div>
<div class="norm">
  <table width="100%" border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="80" align="left" valign="top">Parameter</td>
      <td align="left" valign="top">Summary</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_block_prm_block" class="opt-name">block</a></td>
      <td align="left" valign="top">Defines the block's bounds.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_block_prm_nodata" class="opt-name">nodata</a></td>
      <td align="left" valign="top">Indicates the section that is displayed when there is no data in the data source.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_block_prm_headergrp" class="opt-name">headergrp</a></td>
      <td align="left" valign="top">Indicates a header section that is displayed when the value of a column changes.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_block_prm_footergrp" class="opt-name">footergrp</a></td>
      <td align="left" valign="top">Indicates a footer section that is displayed when the value of a column changes.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_block_prm_splittergrp" class="opt-name">splittergrp</a></td>
      <td align="left" valign="top">Indicates a splitter section that is displayed when the value of a column changes.</td>
    </tr>
    <tr id="v202_parentgrp_sum">
      <td align="left" valign="top"><a href="#html_block_prm_parentgrp" class="opt-name">parentgrp</a></td>
      <td align="left" valign="top">Indicates a parent section that is displayed when the value of a column changes.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_block_prm_serial" class="opt-name">serial</a></td>
      <td align="left" valign="top">Indicates a section that contains a series of several records.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_block_prm_p1" class="opt-name">p1</a></td>
      <td align="left" valign="top">Sends a parameter to the dynamic query for the data source.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_block_prm_sub1" class="opt-name">sub1</a></td>
      <td align="left" valign="top">Define the column containing the data for an automatic subblock.</td>
    </tr>
    <tr id="v205_ondata_sum">
      <td align="left" valign="top"><a href="#html_block_prm_ondata" class="opt-name">ondata</a></td>
      <td align="left" valign="top">Executes a Php user function to modify the record when it has just been taken from the data source.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_block_prm_when" class="opt-name">when</a></td>
      <td align="left" valign="top">Use with <span class="opt-name">onload </span>or <span class="opt-name">onshow</span>. Displays the section when the condition is verified.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_block_prm_default" class="opt-name">default</a></td>
      <td align="left" valign="top">Use with <span class="opt-name">onload </span>or <span class="opt-name">onshow</span>. Displays the section when no section is displayed.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_block_prm_several" class="opt-name">several</a></td>
      <td align="left" valign="top">Use with <span class="opt-name">when</span>. Indicate that several blocks of the group can be displayed.</td>
    </tr>
  </table>
</div>
<div class="title-2"><a name="appendix_specialname" id="appendix_specialname"></a>Names of Special Fields and Blocks:</div>
<div class="norm">
  <table border="0" cellpadding="5" cellspacing="0">
    <tr class="title-1b">
      <td width="140" align="left" valign="top">Name</td>
      <td align="left" valign="top">Summary</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_prm_if" class="opt-name">val</a></td>
      <td align="left" valign="top">The keyword [val] can be used in field's parameters to represent the field's value.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#php_mergeblock_counting" class="opt-name">#</a></td>
      <td align="left" valign="top">Virtual column name for a block. It displays the record's number. </td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#php_mergeblock_counting" class="opt-name">$</a></td>
      <td align="left" valign="top">Virtual column name for a block. It displays the record's key if the data source is a Php Array.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_auto" class="opt-name">onload</a></td>
      <td align="left" valign="top">Automatic field or block, merged when the template is loaded.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_auto" class="opt-name">onshow</a></td>
      <td align="left" valign="top">Automatic field or block, merged when the template is shown.</td>
    </tr>
    <tr>
      <td align="left" valign="top"><a href="#html_field_auto" class="opt-name">var</a></td>
      <td align="left" valign="top">Embedded automatic field.</td>
    </tr>
  </table>
</div>
<div align="center" class="asciiart">.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:</div>
</body>
</html>
Return current item: TinyButStrong