If you'd like to receive a tiny flash news-letter when there is a fresh new release or any interesting information related to TBS, then you can subscribe to TBS-news.
If you'd like to participate, comment, criticize, or just get informed about the development related to TBS (the engines, the plugins, , the tools,..), then you can subscribe to the TBS-dev mailing list. Please note that this mailing list is not for getting help on TBS development, the forum is made for that.
The source code of the TBS project (engine, plug-ins, tools, ...) is hosted at GitHub.
Here are some golden rules for TBS Template Engine. If you know them it will be more easy to build and understand your first TBS templates.
Some other template engines (like Smarty) work by preassigning variables, and the merging is processed in one shot at the end.
TinyButStrong doesn't work this way. As soon as you're calling a method, then the effects are immediately applied into property $TBS->source
.
For example, just after $TBS->LoadTemplate(...)
is called, the property $TBS->Source
already contains the wanted template having all [onload]
tags processed.
Also, when you call $TBS->MergeBlock('b1',...)
then $TBS->Source
contains the result having block "b1" merged. All [b1]
tags have so been replaced and no longer exist.
Knowing this, you can understand that the order of which you are merging blocks can affect the result.
In the example below, merging blocks "gender" and "vip" will not produce the same result has "vip" and "gender". (see golden rule #4 for more details)
[vip.name;block=tr] | Gender: |
Since TBS version 3.2.0, the special [onload]
fields are merged just when $TBS->LoadTemplate()
is called.
For example: in order to merge the global variable $x
, then use [onload.x]
. (references to global variables is a default behavior which can be tuned)
In another hand, the special [onshow]
fields are merged just when $TBS->Show()
is called.
TinyButStrong has some block parameters and some field parameters which are all different.
Examples:
Whether you are using the normal syntax or the simplified syntax, a tag is recognized has a block tag only if it has the parameter block. If it hasn't such a parameter, then any other block parameters are simply ignored by TBS and you won't have any error message for that because TBS allows any extra parameters.
Examples of bad and good:
Bad | Good |
---|---|
[b1.col1;bmagnet=div] | [b1.col1;magnet=div] |
[b2;block=tr;frm='yyyy-mm-dd'] | [b2;block=tr] |
[onload;when [var.x]=1] | [onload;block=tr;when [var.x]=1] |
[var.x;when [var.x]=1;then 'one'] | [var.x;if [var.x]=1;then 'one'] |
In the example below, the block named "b1" has two sections (a yellow one and a blue one). An orange row is placed between those two sections.
But when the block "b1" is merged with $TBS->MergeBlock('b1',...)
then the orange row will be completely deleted and will never be displayed.
TinyButStrong does not keep this zone simply because there is no logical way to process it. When you define the sections of a same block, there should not be any contents between them.
[b1.id;block=tr] |
[b1.id;block=tr] |
This behavior also explains why you're loosing the line breaks placed between <tr>
when your template contains "block=tr".
The line breaks between <tr>
are deleted, all <tr>
sections of the block are collapsed.
If this is a problem for you, you can try the definition "block=tr+_" (see the manual to know more).
Parameters script and file can make TBS to work in a subtemplate mode. In this subtemplate mode, any normal output is stored into a buffer (this includes PHP error messages). When TBS get out of the subtemplate mode, then the buffered data is placed into the template.
Thus if for some reasons a PHP fatal error occurs and stops the running script, then no buffered data is prompted and all what you'll see is a blank page. If you met such a problem, we suggest that you debug your subscript in a normal mode.
If a PHP error occurs but does not stops the running script, then PHP error message will be inserted inside the main template.
How to:
-> There is also a Tips & Tricks forum for more How To.
Problems:
-> You can also perform a search in the forum for more aswers to your problem.
Field and block markers have been set to '[' and ']' only for optimisation consideration. '{' and '}' are common in Javascript code and Style definitions, but '[' and ']' are more rare.
TBS >= 2.02: Markers can have several characters. $TBS = new clsTinyButStrong('{{,}}');
TBS 2.00 and 2.01: Markers must have only one character. $TBS = new clsTinyButStrong('{}');
TBS 1.x (>= 1.60) Markers must have only one character.
$GLOBALS['tbs_ChrOpen'] = '{' ; // to set after include_once('tbs_class.php') $GLOBALS['tbs_ChrClose'] = '}' ;
TBS < 1.60: Markers cannot be changed.
Do: $TBS->Source = $my_string;
To process [onload] tags if any, with TBS >= 3.0: $TBS->MergeField('onload');
To process [onload] tags if any, with TBS < 3.0: $TBS->MergeSpecial('onload');
Limit the hallowed global variables by a prefix: the second argument of the TinyButStrong instantiation enables you to define a prefix for variable limitation in the template.
Example: $TBS = new clsTinyButStrong('','pref_');
Other Var fields will produce a TBS error when the template is processed.
Limit the hallowed global variables by a list:
$allowed_vars['var1'] =& $var1; $allowed_vars['var2'] =& $var2; $TBS = new clsTinyButStrong('','allowed_vars');
Example:
TBS->Render = TBS_NOTHING; // No exit, no output $TBS->Show() // Merges Var fields and [onshow] fields $result = $TBS->Source; // Get the current result
Parameters if and when don't support logical operators, but only comparaisons bewteen two strings.
Operator AND can be replaced by a string concatenation. For example: [onload;if '[var.x1]-[var.x2]'='a-b';then ...]
This condition is the same as: ([var.x1]=='a') AND ([var.x2]=='b')
Since TBS 3.0, you can define several if/then parameters. For example:
[onload;if [var.x1]=1;then 'One';if [var.x1]=2;then 'Two';if [var.x1]=3;then 'Three';else 'More than three']
But for OR usage, and also for more complicated expressions, you will need to use a custom function to performe the check.
Example : [onload;onformat=f_mycheck]
PHP:
function f_mycheck($FldName,&$CurrVal) { global $x1, $x2; if (($x1=='a') OR ($x2=='b')) then { $CurrVal = 'ok'; } else { $CurrVal = 'not ok'; } }
[var]
fields are always examined into parameters file, script, when, if,
and since TBS version 2.02: then, else and subtpl.
TBS fields are not examined in others paremeters. So if you use embedded [var]
fields in other paremeters, they won't be merged in the same time as the embeding field.
Keyword [val]
is supported in parameters file, script, if, then, else and subtpl.
In other parameters this keywords is considered as a common string.
Keyword [val]
is sensitive to the TBS tags markers. For example, if you set the TBS markers to '{' and '}', then the keyword becomes {val}
.
Since TBS version 2.02, there is a new parameter parentgrp that enables you to display a header section that can contain sub-sections of the same block. This is the only case when a TBS section can embed sections of the same block.
TinyButStrong is a Template Engine which has good merging performance. Just a bit faster that Smarty or other without template compilation. Like for any Template Engine, the speed of your merge depends a lot on your template's structure. Here are some advices for optimizing your templates.
Don't multiply automatic fields [onshow]
. It means that you'd better not put [onshow] TBS fields inside some sections of your template that will be merged with MergeBlock()
.
Otherwise, the number of [onshow] fields will be increased before to be merged ([onshow]
fields are processed when Show()
method is called).
This can slow down your merging very much.
[onshow]
fields with [onload]
fields. [onload]
tags are processed just when LoadTemplate()
is called. That is inevitably before any block merging.
So you maybe have to prepare PHP variables used for the conditional statement before this method is called.[onshow]
blocks.[onshow]
.
For the same reason, don't multiply [var]
fields or other TBS fields that could be evaluated only once before a block is merged.
MergeSpecial()
method.MergeField()
method.Use parameter selected with parsimony (not too much). This parameter is quite smart but it needs HTML analyse processes. Such processes cost certain execution time. This is not sensible if they are not numerous, but they can slow down the merge when they are much.
<body>
tag. Another way is to prepare one or several variables in the PHP side that will add
the checked attributes in the tags when needed.<form>
section is big, the more HTML analyse processes cost time.
Think also that you can limit this section using parameter selbounds. When your template has many complex dynamic parts, it is better to migrate the conditional statements from the HTML side to the PHP side.
[
chars are converted into HTML code [
?Since version 1.64, TBS has a Protection System which is enabled by default for each field.
This protection consist in replacing all characters [
with its HTML equivalent [
for any merged data coming from outside the template (PHP variables, MySQL,...). You can deactivate the Protection System for any TBS fields using parameter protect=no.
See the manual for more details.
With TBS version < 2.02, the Protection System stay activated for parameter script.
So if you use this parameter to insert something containing TBS fields, then this fields are disabled by replacement of characters [
with [
To by-pass this problem, you just have to set parameter protect=no in the TBS tag, or to us TBS version >= 2.02.
Example: [onload;script=subcode.php;protect=no]
This example provided with the TBS Example Set needs to have a specific MySQL table and to connect to it. This table is available at this web site but not on your computer. The error message return by PHP is:
Fatal error: Failed opening required '/cnx_mysql.php' (include_path='.;c:\php\includes') in [...]\tbs_us_examples_datamysql.php on line xx
This error message occurs when PHP raise an error when attempting to save the cache file on the server.
Most of the time, this is because there is no 'write' permission on the directory. Try to chnage the Unix permisson.
Then you should probably change the Unix permission of the directory on the server where you're trying to save the cache file.
This can happen if you used the parameter script instead of parameter file.
First check that you 'nodata' section is not embedded into another section of the block.
If you're merging data stored into an array, then an empty data should bee an empty array ( like array()
) ;
values null
or false
are not considered as an empty data. They simply cannod be merged.
Example of what you can do to be sure that data is not the false or the null value:
$data = ... if ($data===false) $data = array(); $TBS->MergeBlock('blk',$data);
They are two cases when a block parameter seems to be ignored by TBS. The first one in when the block parameter is not placed in the TBS tag that contains the block definition. That is TBS tag with parameter block=.... The second case is when you have too much parameter block=... inside a section. In such a case, only the first parameter block=... is taken in acount ; following block definition are ignored (note taht with explicit syntax, following tag with block=end is accepeted).
Here are some examples :
• <div>[blk1.firstname;block=div] ... [blk1.subname;ondata=my_function]</div>
Bad : parameter ondata is ignored because there is no block definition (block=...') in its TBS tag.
• <div>[blk1.firstname;block=div] ... [blk1.subname;block=div;ondata=my_function]</div>
Bad : parameter ondata is ignored because a previous block definition (block=div) has been taking in acount.
Don't forget that only one parameter block= is enougth for each section of a block (two with explicit syntax).
• <div>[blk1.firstname;block=div;ondata=my_function] ... [blk1.subname]</div>
Good : Block parameters are placed together.
A usual mistake is when you put TBS a field linked to a block inside the conditional statement of an [onload]
tag.
Remember that an [onload]
tag is automatically processed as soon as you call the LoadTemplate()
method.
Therefore, no TBS field of block is merged yet because no MergeBlock() method has been called before.
Example :
• <div>[onload;block=div;when [blk1.colmun]=3] ... </div>
Bad : The TBS fields [blk1.colmun] is not yet merged before calling LoadTemplate()
TBS is just checking is string [blk1.colmun]
is equal to string 3
. Which is always false.
• <div>[onshow;block=div;when [blk1.colmun]=3] ... </div>
Good : TBS field [blk1.colmun] can be merged before calling Show()
.
TinyButStrong is a Template Engine which has good merging performance. Just a bit faster that Smarty or other without template compilation. Like for any Template Engine, the speed of your merge depends a lot on your template's structure. Here are some advices for optimizing your templates.
Don't multiply automatic fields [onshow]
. It means that you'd better not put [onshow]
TBS fields inside some sections of your template that will be merged with MergeBlock(). Otherwise, the number of [onshow]
fields will be increased before to be merged ([onshow]
fields are processed when Show() method is called). This can slow down your merging very much.
[onshow]
fields with [onload]
fields. [onload]
tags are processed just when LoadTemplate() is called. That is inevitably before any block merging. So you maybe have to prepare PHP variables used for the conditional statement before this method is called.[onshow]
blocks.[onshow]
.
For the same reason, don't multiply Var fields or other TBS fields that could be evaluated only once before a block is merged.
MergeSpecial()
method.MergeField()
method.Use parameter selected with parsimony (not too much). This parameter is quite smart but it needs HTML analyse processes. Such processes cost certain execution time. This is not sensible if they are not numerous, but they can slow down the merge when they are much.
<body>
tag.
Another way is to prepare one or several variables in the PHP side that will add the checked attributes in the tags when needed.
<form>
section is big, the more HTML analyse processes cost time.
Think also that you can limit this section using parameter selbounds.
When your template has many complex dynamic parts, it is better to migrate the conditional statements from the HTML side to the PHP side.
New features: | |
New method GetAttValue($Name[,$delete]) : enables you to read an attribute of an HTML or XML element in the template. | |
New method ReplaceFields(array($name=>$prms) [, $BlocName]) : replace simple TBS fields with new definitions of fields. | |
New parameter 'combo' : apply a set of parameters defined at the PHP side using SetOption('prm_combo'). | |
Enhancements: | |
Subnames for fields, array queries and ObjectRef path can support methods overloaded with magic function _call(). | |
Fixed bugs: | |
PHP error: one meth_Misc_Alert() called with a wrong number of arguments. |
Enhancements: | |
Coding OnCacheField event in a plug-in: stronger way to manage embedding fields + support property DelMe. | |
Fixed bugs: | |
Coding OnCacheField event in a plug-in: in some circumstances, moved locators may be ignored by TBS. Could happen with OpenTBS when using parameter "ope=tbs:num" or a similar operator. |
New features: | |
New option "methods_allowed" for allowing methods on automatic fields. | |
Fixed bugs: | |
Explicit error message when a column is missing for a grouping parameter (headergrp, footergrp, splittergrp) |
Fixed bugs: | |
Plugin MergeOnFly: debug mode was activated by default. | |
Error with PHP 5.4 : Unexpected PHP error [Array to string conversion] severity [E_NOTICE] in [tbs_class.php line 72] |
New features: | |
New property VarRef: enables you to redefine the scope of automatic fields ([onshow], [onload] and [var]) | |
New data source supported in native: Zend DB Adapter | |
New methods SetOption() and GetOption(): hamonize the management of TBS options. | |
Option "include_path": enables you to define include paths for templates and sub-templates. | |
Option "block_alias": enables you to define alias of block. | |
Option "tpl_frms": enables you to define TBS formats. | |
parameter 'frm' now supports the thousand seperator with several characters. Useful for HTML entites for example. | |
New values supported by parameter "ope": upper, lower, upper1, upperw, utf8 | |
New parameters store and storename: enable you to bufferize the content of a sub-templates in a store, that you can replace anywhere in the main template using [onshow..store]. Usefull for developping sub-templates as components. | |
New special field [onshow..php_info]: insert the php info. | |
Enhancements: | |
New property ExtendedMethods: enables plug-in coders to add new TBS methods (PHP 5 only) | |
Parameter magnet=# is supported even if parameter att is not used. | |
Parameter enlarge is a new alias of parameter comm | |
Parameter getpart is a new alias of parameter getbody | |
Parameter strconv is a new alias of parameter htmlconv | |
Fixed bugs: | |
A string [] appears in the contents when parameter "att" is used with a "parentgrp" block. | |
using parameter getbody : Notice: Trying to get property of non-object in ...\tbs_class.php on line 3775 | |
with PHP 4 (who use it?): PDO::FETCH_ASSOC is not recognized |
New features: | |
Support MySQLi connectivity in native. | |
Support PDO connectivity in native. | |
MergeBlock() accepts a new argument for Query parameters. | |
Method PlugIn() support direct commands. | |
New internal method meth_PlugIn_SetEvent() for enable/disable a plug-in's event. | |
New f_Xml_FindTagStart() which can be useful for plug-ins and external tools (yet used in OpenTBS and Excel plug-in) | |
Enhancements: | |
Better management of fields put in cache when parameter att is used. | |
Fixed bugs: | |
Internal method f_Xml_AttFind() does not find attributes that have uppercase characters, that's because f_Loc_PrmRead() save attributes lowercase. | |
Internal method f_Misc_GetFile() founds the correct size using fstat(). | |
The special automatic field [onshow..template_date] now call f_Misc_GetFile() in order to be sure to found the file the same way. | |
Parameter mtype=*m or mtype=m* does't use encapsulation level. Now it can find <br />. | |
When parameter ondata is used on a array string then $CurrRec is not an array. "Warning: Cannot use a scalar value as an array in [...]" http://www.tinybutstrong.com/forum.php?thr=2673 |
New features: | |
Automatic subblocks can now be direct, i.e without a column. | |
Fixed bugs: | |
MergeBlock() with 'text' source doesn't work with multiple blocks. http://www.tinybutstrong.com/forum.php?thr=2569 |
|
Parameter rename (to be used with parameters file or script) doesn't rename fields that have no subname or parameter. |
New features: | |
New keyword htmlconv=utf8: enables you to directly convert the data item into UTF-8. | |
New operator msk: apply a mask on the current data item. Example; ope=msk:prefix_*_suffix | |
New plugin event OnCacheField, it's triggered when a field is put in the cache of a block definition. | |
New properties OnLoad and OnShow: enable you to prevent the processing of automatic fields and blocks. May be useful for plug-ins | |
New parameter atttrue (mean "attribute true"). To be used with parameter att. Turn the attribute to have a Boolean behavior, which becomes true for the given value. Example: [var.x;att=input#selected;atttrue=29] will add "selected=selected" if $x=29, otherwise the attribute is omitted. | |
TBS can now restrict the PHP functions allowed for parameters ondata and onformat. Example: $TBS = new clsTinyButStrong('','','f_allowed_'); |
|
Automatic subblocks now support optional columns. The column is optional if is defined with parenthesis. If the optional column is missing then the subblock is considered as empty. Example: [author;block=tr;sub1=(books)] |
|
Fixed bugs: | |
Parameter getbody without value is not working. | |
Parameter att doesn't work when placed in inside the target tag and before the target attribute. http://tinybutstrong.com/forum.php?msg_id=10899 | |
GetBlockSource() with arguments AsArray=false and DefTags=false does ignore DefTags=false. | |
If an automatic subblock has a null value instead of nodata then it displays "TinyButStrong Error when merging block [xxx_sub1] : unsupported variable type : 'NULL'.". This bug is now fixed and a null value means an empty subblock. | |
A subblock with a dynamic queries can display "TinyButStrong Error when merging block" (with the keyword %p1% in the query) when it founds parameter "p1=" without value. This can happen for instance when the main block had a null or empty value for the linked column. | |
Parameter valsep (to be used with ope=list) doesn't work as expected if its value is HTML/XML encoded. The final value includes re-encoded value separators. |
Fixed bugs: | |
"Notice : Undefined property: clsTbsLocator::$RightLevel". This warning message appeared in TBS 3.5.2 when you use block=_ . |
New features: | |
XML/HTML single tags <x/> are now considered like <x></x>. Thus, coding "block=img" will work correctly if the TBS fields is embedded in the <img/> tag. Example: <img [b;block=img] /> | |
Parameter frm supports leading zeros. Example: frm=00. (idea submitted by Jérémy) | |
New parameter maxutf8 allows the max operator to work with utf8 data. (idea submitted by Jérémy) Example: [onshow.x;ope=max:10;maxutf8] |
|
New operator mok (means Magnet OK). To be used with parameter magnet. Example: [onshow.x;magnet=div;ope=mok:xxx]. The TBS field is never displayed, but the magnet tag is displayed only if the TBS field’s value is xxx. Otherwise, the magnet tag is deleted. | |
New operator mko (means Magnet KO). Same as mok but the magnet tag is deleted only if the TBS field’s value is xxx. | |
New keyword: htmlconv=url enables you to formate a string to be instered in URL. | |
Enhancements: | |
Deleting an attribute using magnet=# does no longer add a new space in the tag. | |
f_Xml_FindTag() is a bit faster. | |
Some code embellish. | |
Fixed bugs: | |
Defining a block on a single tag using "block=tag/" doesn’t work. TBS did not manage the embedding level correctly. | |
"Warning: Parameter 4 to ... expected to be a reference, value given" Error message when using a plugin event OnFormat or an onformat custom function that use the argument $TBS. Happens only since PHP => 5.3.0. (bug reported by Jérémy) |
|
The virtual column $ returns the record num instead of the item key when calling MergeBlock with a datasource which is an ArrayIterator. (bug reported by Jérémy) | |
MergeField('onload'), MergeField('onshow') and MergeField('var') produce a TBS error message about property Assigned. This bug has appeared since TBS 3.5.0. (bug reported by Achille) | |
Parameter ope=nif is not working when the value to merge is not a string. (bug found by Figo) |
New features: | |
New parameter rename to change the name of TBS blocks and fields when a subtemplate is insterted. | |
Fixed bugs: | |
Support block definitions on XML tags that can be either single or opening/closing couple. Since XHTML, tags such as <div /> are allowed. Now they make no error to found the bounds a TBS blocks when such tags are used. |
|
When a XML/HTML attribute was not correctly ended the TBS could produce an infinite loop under some circumstances. For example when using parameter att, or with plug-in HTML. |
|
$TBS->TplVars was erroneously cleared when $HtmlCharSet='+'. | |
New way of checking PHP version. |
New features: | |
New parameter att. This is a powerful feature that moves a field inside an XML/HTML attribute before to merge it. Parameter attadd makes the merged value to be added to the current attribute's value instead of replace it. | |
New property Assigned to prepare data to be merged manually or automatically with MergeBlock() and MergeField(). | |
MergeBlock() allows automatic subblocks. When the source of the data has a column containing subdata, then it is possible to define a subblock that will be merged automatically without needing an extra MergeBlock(). | |
Method MergeBlock() natively supports Iterator, ArrayObject and IteratorAggregate. (PHP 5 only) | |
New special var field [var.error_msg] which displays TBS error messages in your template when property NoErr=true. | |
Enhancements: | |
MergeField() allows to define a set of default parameters. Example: $TBS->MergeField('mf',date('Ymd'),false,array('frm'=>'dd/mm/yyyy')); |
|
Parameter getbody can now retrieve several parts of the subtemplate, including tags or not. Example: [onload;file=;getbody=(script)+(style)+body] |
|
MergeBlock() allows columns names with spaces. | |
GetBlockSource() allows to delete the block source or to replace it with a string. | |
Method LoadTemplate() supports a Charset argument that is an array. | |
Security | |
Security fix: automatic fields ([onload], [onshow] and [var]) are not allowed to call object's methods unless property $TBS->MethodsAllowed is set to true. | |
Fixed bugs: | |
Fatal error: Call to undefined method clsTbsDataSource::f_Misc_CheckArgLst(). | |
Notice: Undefined property: clsTinyButStrong::$_PlugIns_Ok_save Notice: Undefined property: clsTinyButStrong::$_piOnFrm_Ok_save |
|
Fix a potential problem about respecting plugin syntax: plugin's events OnFormat and OnOperation. | |
Warning of 2 undefined variables. See http://tinybutstrong.com/forum.php?msg_id=9265 | |
Parameter mtype doesn't work properly when use with ope=minv. See http://www.tinybutstrong.com/forum.php?msg_id=9814 | |
The merging process doesn't found a property added manually on the instance of an objet. See http://www.tinybutstrong.com/forum.php?msg_id=9508 | |
A template format with numerical definition can not be displayed correclty. | |
Miscellaneous: | |
TBS is under the LGPL license version 3 instead of 2.1 |
New features: | |
New parameter tplfrms to create template formats. Template formats are TBS format for date and number which is defined once and can be references by its name. Example: [onload;tplfrms;doll=$ 0,000.00] ... [var..amount;frm=doll] |
|
New keyword (locale) for date formats. Insert this keyword inside a date format in order to specify that the formatting must use the loclae settings. Example: [var.date;frm=(locale)mmmm yyyy] It does the same as the seperated parameter locale which becomes deprecated. |
|
Fixed bugs: | |
Avoid infinite loops when a subblock meets an SQL error. | |
Bad condition evaluation when the first element contains the symbol equal (=). Now it can be escaped with single quote ('). | |
Now, LoadTemplate(null,HtmlCharset) do run Plugins, Onload and HtmlCharset without changing the template, like the documentation says. | |
Now, LoadTemplate('',HtmlCharset) do change HtmlCharset without changing the template, like the documentation says. | |
Now, formatted dates with the locale option are converted with the HtmlCharset of the template. This is because they may have accents. |
New features: | |
LoadTemplate('',$charset) set the charset without changing the current template. This enables you, for example, to load a template from a string and then set the relevant chartset. |
|
New plug-in event: OnMergeGroup. It occurs when a header, a footer or a splitter is merged. |
|
Parameter ope=nif:xxx replaces the value with null when it's equale to xxx. It's a shortcut for [val]='xxx';then '';. |
|
Parameter ope=minv makes parameter magnet work properly but turns the final value to be null. This i a way to make invisible fields which can manage magnets stuffs. |
|
Enhancements: | |
Paremeters headergrp, parentgrp and footergrp work for any kind of data source (array, object, ...)
and also with sub items. You can even use the virtual columns # and $. Example: [blk;block=tr;headergrp=#] or [blk;block=tr;headergrp=ident.name] |
|
Fields in the conditional clause of a section are also cached. | |
Templates and subtemplates are also searched in include_path. | |
Custom functions for LoadTemplate support a new argument to process newline characters. | |
MergeField('onload') also merges variable fields such as [onload.x]. | |
MergeBlock('blk','cond') also merges var fields such as [blk.x] and [blk;file=...] just like [onload] and [onshow] do. |
|
The code source has no more plublic functions. | |
Fixed bugs: | |
Wrong merging when a block is using parameter "p1" and having a field outside the block. See related topic |
|
Now [var..now] uses time() instead of mktime(). See related topic |
|
Now there is a TBS error message when [onload;block=...] doesn't found the block which is defined. |
New feature: Onload [var] fields. Now a field like [onload.x] can display a PHP variable $x as soon as the template is loaded. It is very useful for optimization. |
|
New feature: special var field [var..cst.*] Display a PHP constant. |
|
New feature: special var field [var..tbs_info] Display some information about TBS version, PHP version and installed plug-ins. |
|
New feature: enhancement for parameter ope. Parameter ope can have several operations. It supports real values, and two new operations : div and mul. Example : [var.x;ope=mul:2,add:1.5] |
|
New feature: enhancement for files. The LoadTemplate() method, and both parameters file and script also look their file in the directory of the last opened template. It can be useful to simplify subtemplate inclusion. |
|
New feature: new time formats. - h for hour-24 without the leading zero, - rr for hour-12 with the leading zero, - r for hour-12 with the leading zero, hm becomes deprecated. You cannot use double quote (") as a string delimiter in date-time formats anymore, only simple quote ('). |
|
New feature: undocumented property ErrCount. Incremented when a TBS error is met. |
|
New feature: undocumented property RecheckObj. | |
Optimization: The class is smaller and faster than previous versions. | |
Enhancement: Some error messages are clearer. | |
Fixed bug: an extra empty line could be displayed when using parameter serial and headergrp in the same block. | |
Fixed bug: Warning: Missing argument 3 for tbs_misc_getfile() This message could appear under certain circumstances. |
|
Fixed bug: Bad eror message could be prompted when a custom function fail to open a query. | |
Fixed bug: Problems when another script create functions array_key_exists() and property_exists() before TBS does. | |
Fixed bug: An unwanted extra line could be added when parameter block=_ was used on a TBS tag placed on the very beginning of a line. | |
Fixed bug: HTML attribute not recognized when glued to the bottom of its tag. Example : <input value="1"/> could be not recognized. |
|
+ | Internal change: Code optimized for block analysis. $LocR structure modified (undocumented, this is for plug-in developers). |
+ | Internal change: Code optimized for custom function check. You can now preload a custom function set associated with a keyword. (undocumented). |
Fixed bug: Bad result when using parameter magnet with mtype=*m In TBS 3.1.0 a field using this value was always bad processed. |
New feature: block=_ Now you can define a block to be the file line on which the TBS tag is defined. This feature recognizes Linux, Mac and Windows new-line chars. Among other things, this can be useful when you're working on text files. It also works for extending blocks. Example : block=_+(_)+_ or block=span+_ |
|
New feature: block=tag/ 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 openning HTML tag which contains the TBS tag. This can be useful to multiply an image for example. |
|
Fixed bug: Bad merged blocks when using a definition like block=tag+tag TBS could make a confusion on block's limits when using a block's definition containing several tags with common names. |
|
Fixed bug: TinyButStrong Error: item ... is neither a method nor a property in the class ... This message could happen when a TBS field tryied to display the an object's property having a null value. Now the null value is corretly taken in acount, but because of PHP restrictions, undefined properties won't produce a TBS error anymore with PHP version lower than 5.1.0. |
|
Fixed bug: The plug-in event Ondata started before event BeforeMergeBlock. Now BeforeMergeBlock event always start before Ondata. |
|
Fixed bug: Notice: Undefined offset: 0 in ... on line ... This message could happen when you tried to merge a block that have special sections (like serial or headergrp) but no normal sections. Such blocks can now be merged without error message. |
|
Fixed bug: Variables $CurrVal and $CurrPrm not available when using parameter script. Those variables were mentioned in the manual but not available. Now they are. |
|
Fixed bug: Error message: pg_fetch_array(): Unable to jump to row ... This could happens under misterious circumpstances when using PostgreSQL and PHP 5. |
|
Plug-in HTML and ByPage need to be upgraded to works with TBS 3.1.0 |
Fixed bug: error when using MergeBlock() with objects. |
Fixed bug: date formated displays 1st jan 1970. This could occur with PHP 5.1.0 or higher and with a value which is a timestamp. This is because since PHP 5.1.0, the function strtotime() returns false instead of -1 for a bad time value. You have a description of the problem in the forum. |
Fixed bug: Problems with data or variables when using the TBS syntax for subitems. Some data change could occur in some circumstances: - [var] fields calling an object's method - Array dynamic queries calling an object's method or property - Parameter onformat or ondata calling an object's method or property |
Fixed bug: Error message Warning: Missing argument 1 for aftershow() in ... This could happen when a plug-in is installed in a sub-template script (called by parameter script). Plug-in CacheSystem has been changed too in order to feet with this fix. |
Fixed bug: Bad argument supplied to plug-in's event OnMergeField. | |
Fixed bug: Problems with plug-in's event AfterShow. Now Ouput and Exit happens after event AfterShow. You can cancel them using argument $Render. Plug-in CacheSystem has been changed too in order to feet with this fix. |
|
+ | Comments in the file tbs_plugin_syntaxes has been uptated. |
Fixed bug: [var] fields embedded into a parameter 'script' were not merged. |
Fixed bug: [var] fields embedded into a parameter 'script' were not merged. |
Lot of new features, see document [What's new with TBS 3.0] |
Changelog for TBS 2.x is backuped here.
Changelog for TBS 1.x is backuped here.
TinyButStrong is released under the LGPL (Lesser General Public Licence).
In summary it means that:
Read other terms and conditions at the LGPL offical web site.
For questions, help, how to, bug reports, comments... contact us.