Categories > TinyButStrong general >

Save output to file

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Shinoda
Date: 2004-12-23
Time: 15:28

Save output to file

I'm trying to make an rss feed and i need to save the result of the merge to a .xml instead of showing it in the screen.

Is it possible?

Ty :)
By: Skrol29
Date: 2004-12-23
Time: 20:41

Re: Save output to file

Hello,

Yes of course.
See the Render property. It enables you to not show and/or not exit the script after the merge.
By: Anonymous
Date: 2004-12-24
Time: 16:38

Re: Save output to file

The problem is that i don't know how to save the result to a file, i'm trying this:

[Db code here]
$tpl->MergeBlock('feeds',$feeds);
$tpl->Render = TBS_NOTHING;
$xml = $tpl->Show();
$open = fopen($basedir . 'rss/rss.xml','w');
fwrite($open, $xml);

but rss.xml remains with 0 bytes :(

Tks for your answer.
By: Skrol29
Date: 2004-12-25
Time: 00:27

Re: Save output to file

Just relace
  $xml = $tpl->Show();
with
  $tpl->Show();
  $xml = $tpl->Source;
By: Anonymous
Date: 2004-12-27
Time: 00:14

Re: Save output to file

Many thanks for your answer, it worked :)