TinyButStrong
Encyclopedia
TinyButStrong is a web template system
Web template system
A Web template system describes the software and methodologies used to produce web pages and for deployment on websites and delivery over the Internet. Such systems process web templates, using a template engine...

 written in the PHP
PHP
PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...

 language. Its library for the attention of PHP developers. As a template system, its goal is to help to code by separating the business algorithm
Algorithm
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...

s (Business logic
Business logic
Business logic, or domain logic, is a non-technical term generally used to describe the functional algorithms that handle information exchange between a database and a user interface.- Scope of business logic :Business logic:...

) from the construction of the user presentation. The short name for TinyButStrong is TBS.

The first version of TinyButStrong appeared in January 2002. Its first goal was to merge emails. In the middle 2002, it was able to merge dynamic web page
Dynamic web page
A dynamic web page is a kind of web page that has been prepared with fresh information , for each individual viewing. It is not static because it changes with the time , the user , the user interaction , the context A dynamic web page is a kind of web page that has been prepared with fresh...

s. The name of TinyButStrong comes from the intention to be simple to use while being handy for several levels of developers. TinyButStrong was always content in a single PHP file.

The TinyButStrong Template Engine claims to merge Natural Templates, i.e. templates that respect the format of the final document to produce. It is possible to build an HTML template that is W3C compliant, and it is possible to build it using a WYSIWYG
WYSIWYG
WYSIWYG is an acronym for What You See Is What You Get. The term is used in computing to describe a system in which content displayed onscreen during editing appears in a form closely corresponding to its appearance when printed or displayed as a finished product...

 tool. It is also possible to build an OpenOffice Writer template using OpenOffice.

This ability to operate within an environment where website designers use WYSIWYG tools is crucial for end users during website development. It enables them to utilize separate vendors - one for their 'look & feel' designers and other(s) for their programming requirements. Obviously, this extends the lifecycle as their ability to change vendors with much less difficulty in replacing specific skill sets is enhanced substantially.

The TinyButStrong engine can only deals with template that are text sources. Thus is can merge contents like HTML pages, email, XML, or RSS, but it cannot merge templates such as PDF. The core system contains few features dedicated to HTML templates.

TinyButStrong can be extended to merge OpenOffice and Ms Office documents. This is possible because such documents are in fact XML contents embed in a zip archive. Building such documents with TinyButStrong requires a plug-in called OpenTBS.

Features

  • Merge data items (by replacing located tags)
  • Merge data records (extending or deleting blocks)
  • Formatting items using native numeric or date formats, or using custom functions.
  • Conditional expressions for items and blocks
  • Merge data record directly with SQL statements (several Databases and data Sources are supported in native, other can be add using plug-ins).
  • Sub-blocks, serialized blocs, sub-templates,
  • Events to be cached by PHP functions
  • Caching pages
  • Plug-ins
  • Native database query debugging console

TinyButStrong Examples

An HTML template with TinyButStrong tags might look like this:




[onshow.title]


[onshow.message]



The business logic to use the TinyButStrong template above could be as follows:

include_once('tbs_class.php');
$TBS = new clsTinyButStrong;
$TBS->LoadTemplate('template.htm');

$title = 'Example Page';
$message = 'Hello';

$TBS->Show;

Natural Templates

Natural Templates are templates that respect the format of the final document to produce.
This can be done by TinyButStrong because:
  • the syntax of TinyButStrong tags does not interfere with the syntax of the template format
  • both field and block tags can be defined in the visual part of the template

Relative syntax for blocks

Here is an example of the TinyButStrong standard syntax for a block that should multiply the rows of an HTML table. This syntax interferes with the HTML structure.



[block1;block=begin]

[block2;block=end]
Id Name
[block1.id] [block1.name]



Here is an example of the TinyButStrong relative syntax for the same block. This syntax doesn't interfere with the HTML structure.




Id Name
[block1.id] [block1.name;block=tr]


Relative syntax for fields

Here is an example of the TinyButStrong standard syntax for a field that should change the value of an HTML attribute. This syntax interferes with the HTML structure.




Here is an example of the TinyButStrong relative syntax for the same field. This syntax doesn't interferes with the HTML structure.


The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK