|
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 |
monoxide Smarty n00b
Joined: 31 Oct 2009 Posts: 4
|
Posted: Fri Nov 27, 2009 8:50 am Post subject: Smarty 3: {assign} doesn't assign to smarty.session |
|
|
I have the following code that I'm 90% sure used to work (in Smarty 3).
Code: |
{if not empty($smarty.session.errors.comment)}
<div class="error">{$smarty.session.errors.comment}</div>
{assign var='smarty.session.errors.comment' value=''}
{/if}
|
This isn't assigning anything, even locally. If I change it to:
Code: |
{if not empty($smarty.session.errors.comment)}
<div class="error">{$smarty.session.errors.comment}</div>
{assign var='smarty.session.errors.comment' value=''}
{$smarty.session.errors.comment}
{/if}
|
It prints out twice. Is this a bug, or is it something that changed at some point? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Nov 27, 2009 12:51 pm Post subject: |
|
|
If you read the special Smarty variable $smarty.session the PHP $_SESSION variable gets accessed. This is readonly. You can't write to it. This never has been possible. |
|
Back to top |
|
monoxide Smarty n00b
Joined: 31 Oct 2009 Posts: 4
|
Posted: Fri Nov 27, 2009 8:40 pm Post subject: |
|
|
I'm pretty sure it worked at some point in 3.0a, but it might have been a bug at that point... Oh well, time to rethink how I'm doing this then. |
|
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
|