Categories > TinyButStrong general >

tbs in a functon ?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Charles
Date: 2003-06-17
Time: 12:06

tbs in a functon ?

Hi, and congratulation for your work !
I try to code somthing like :

html>
<body>
<?PHP

function show()
{
    include_once("tbs_class.php");
    $tmp = 1;
    $TBS=new clsTinyButStrong;
    $TBS->LoadTemplate('exe.htm');
    $TBS->Render = TBS_OUTPUT;
    $TBS->Show();
}
show();
?>
</body>
</html>


whith exe.htm : <p>[var.tmp]</p>

but the fusion doesn't work... what can i do for remedy this ?
(I'm obliged to put the $TBS->Show () in a function)
Thanks
Charles
By: Skrol29
Date: 2003-06-17
Time: 18:01

Re: tbs in a functon ?

Hello Charles,

The merge doesn't work because $tmp is a local variable and [var.*] fields are for global variables.
Add the falowing line at the beginning of you function andit should works:
  global $tmp ;

By: Charles
Date: 2003-06-18
Time: 08:55

Re: tbs in a functon ?

Of course...
Thank you