Categories > TinyButStrong general >

excuse me, how can i save the php result into a HTML file?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: gavin
Date: 2006-03-17
Time: 07:55

excuse me, how can i save the php result into a HTML file?

Sorry for my poor english :)
I want save the PHP result into a HTML file with TBS.
How to do it ?
example:
<?php

include_once('tbs_class.php') ;

$x = 'Hello World';

$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate('tbs_us_examples_hello.htm') ;
$TBS->Show() ;

?>

and how to save the result into a static page "helloworld.html"?
What's the code.

Thank you!
By: Skrol29
Date: 2006-03-17
Time: 09:56

Re: excuse me, how can i save the php result into a HTML file?

Hello,

Use the property ->Render or the argument $Render of the Show() method to avoid TBS to ends the script when using Show().
You can then retrieve the contents of the current merged template using property ->Source.

Example:
$TBS->LoadTemplate('tbs_us_examples_hello.htm') ;
$TBS->Show(TBS_OUTPUT); // no exit
$html_contents = $TBS->Source;
... / Save the contents here
exit;
By: gavin
Date: 2006-03-17
Time: 10:14

Re: excuse me, how can i save the php result into a HTML file?

i see... Thank you very much!