|
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 |
burnmill Smarty n00b
Joined: 14 May 2014 Posts: 2
|
Posted: Wed May 14, 2014 2:07 pm Post subject: Caching trouble? |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed May 14, 2014 7:41 pm Post subject: |
|
|
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 |
|
burnmill Smarty n00b
Joined: 14 May 2014 Posts: 2
|
Posted: Wed May 14, 2014 8:15 pm Post subject: |
|
|
Thanks alot! Works great!
/Erik |
|
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
|