Categories > TinyButStrong general >

calling a function from within tbs template

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Will Robertson
Date: 2003-07-04
Time: 22:49

calling a function from within tbs template

Okay, pretty much what I want to do is call a function in the middle of the page.

<?
function blah($arg1) {
  global $TBS, $randomdatasource;
  $TBS->MergeBlock(arg1, $randomdatasource);
}

?>

How would I call that from inside the HTML template?
By: Skrol29
Date: 2003-07-04
Time: 23:23

Re: calling a function from within tbs template

Hello Will,

They are two ways to execute Php code from a template.

-> the 'script' parameter, which executes a php script and can divert string passed to echo into the TBS locator.

-> the 'onformat' parameter which calls the user function you whant (but with a specific syntax) when a merge-field or a merge-block has to be merged.