Ok.
When you write
$TBS = new clsTinyButStrong ;
|
it creates a new object variable named $TBS which is an new 'instance' of the class 'clsTinyButStrong'.
Those are technical terms of Oriented Object Programing.
When you code $TBS->LoadTemplate(...) or $TBS->MergeBlock(...), this changes the value of the property $TBS->Source.
$TBS->Source is a kind of sub-variable attached to the variable $TBS.
When you code $TBS->Show(), this merge automatic fields and then performs
Now, when you code:
$TBS1 = new clsTinyButStrong ;
$TBS2 = new clsTinyButStrong ;
|
it creates two objects variables (instances), with their own sub-variables (properties). Therefore $TBS1->Source and $TBS2->Source are two different values.
You can play with that. Loading the first template in $TBS1, and the other in $TBS2. Merging blocks as needed on each instance.
Before the end, you can manage the two contents as needed.
Example : $TBS1->Source = $TBS1->Source.$TBS2->Source ;
This adds the result of $TBS2 afed the result of $TBS1.
Or:
$TBS1->MergeBlock('subtpl','text',$TBS2->Source) ;
This merges the block named 'subtpl' placed in $TBS1 with the result of $TBS2.
A last tip: you can call the $TBS->Show() method without displaying the result. See the Render property in the manual for more details.