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

Alternative to Display()

 
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 -> Feature Requests
View previous topic :: View next topic  
Author Message
bsaksida
Smarty n00b


Joined: 07 Oct 2006
Posts: 2

PostPosted: Sun Nov 19, 2006 5:05 pm    Post subject: Alternative to Display() Reply with quote

I woud like to have a function to do exactly like Display, exept it will not display to browser, but it woud return as a string. This woud be useful for emails, like email confirmations, reset password and so on.
Back to top
View user's profile Send private message
reb
Smarty Rookie


Joined: 17 Aug 2005
Posts: 23

PostPosted: Sun Nov 19, 2006 5:28 pm    Post subject: $smarty->fetch() Reply with quote

Code:
$myString = $smarty->fetch('template.tpl');


Last edited by reb on Wed May 05, 2010 10:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hielke Hoeve
Smarty Elite


Joined: 06 Jan 2006
Posts: 406
Location: Netherlands

PostPosted: Sun Nov 19, 2006 7:06 pm    Post subject: Reply with quote

http://smarty.php.net/manual/en/language.function.fetch.php
_________________
Debug XHTML Compliance
SmartyPaginate
Smarty License Questions
---
(About Unix) The learning curve is full of aha! moments, such as that glorious day that the full beauty of grep and, later, find is revealed in all its majesty. --- Robert Uhl <ruhl@4dv.net>
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Sun Nov 19, 2006 10:54 pm    Post subject: Reply with quote

Yes, reb has it right. Use the api method fetch().

http://smarty.php.net/manual/en/api.fetch.php

The template function {fetch} is something else.
Back to top
View user's profile Send private message
bsaksida
Smarty n00b


Joined: 07 Oct 2006
Posts: 2

PostPosted: Mon Nov 20, 2006 4:32 am    Post subject: Reply with quote

I was searching for this function and coudn't find it. Many thanks
Back to top
View user's profile Send private message
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 -> Feature Requests 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