|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Stephanie Smarty Rookie
Joined: 12 Dec 2005 Posts: 7
|
Posted: Mon Nov 21, 2011 8:30 pm Post subject: Creating a downloadable file from a Smarty template |
|
|
I want to be able to create a download file of my Smarty output. Specifically, I have a template that creates XML. I want to be able to have that download directly to the user's computer as a .xml file.
Any ideas? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Nov 21, 2011 8:46 pm Post subject: |
|
|
maybe this:
Code: | header('Content-disposition: attachment; filename="foo.xml"');
header('Content-type: "text/xml"; charset="utf8"');
$smarty->display('foo.tpl'); |
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|