Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Assigning output to a variable

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
abuijze
Smarty n00b


Joined: 08 Mar 2005
Posts: 1
Location: Netherlands / The Hague

PostPosted: Tue Mar 08, 2005 9:39 pm    Post subject: Assigning output to a variable Reply with quote

I was looking fo a way to assign the output the display function to a variable. I couldn't find it, but I foud a workaround. If anyone is interested:

Code:
ob_start();
$smarty->display("template.tpl");
$var = ob_get_contents();
ob_clean();


the information is not sent to the browser, but assigned to the variable $var instead.
Back to top
View user's profile Send private message Visit poster's website
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Mar 08, 2005 9:45 pm    Post subject: Reply with quote

no need.

http://smarty.php.net/fetch
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP