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

Caching trouble?

 
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 -> General
View previous topic :: View next topic  
Author Message
burnmill
Smarty n00b


Joined: 14 May 2014
Posts: 2

PostPosted: Wed May 14, 2014 2:07 pm    Post subject: Caching trouble? Reply with quote

I have code along these lines

Code:
sendasmail($smarty->fetch('my.tpl', mailadress));
$smarty->assign('notmail', true);
$smarty->display('my.tpl');


and a template

Code:
write some thing
{{if $notmail}}
write something else
{{/if}}
write foot


But both the mail and the returned page are the same.
Can't I do this or?

/Erik
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Wed May 14, 2014 7:41 pm    Post subject: Reply with quote

If you have caching enabled you must make sure that your variable is evaluated in nocache mode.



Code:
write some thing
{{if $notmail nocache}}
write something else
{{/if}}
write foot
Back to top
View user's profile Send private message
burnmill
Smarty n00b


Joined: 14 May 2014
Posts: 2

PostPosted: Wed May 14, 2014 8:15 pm    Post subject: Reply with quote

Thanks alot! Works great!

/Erik
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 -> General 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