Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Assigning variable with global scope inside function

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
ilyalyu
Smarty Regular


Joined: 03 Nov 2009
Posts: 72

PostPosted: Sun Nov 25, 2012 8:05 am    Post subject: Assigning variable with global scope inside function Reply with quote

Assigning variable with global scope inside function does not seem to work. The following code:
Code:
{function "f"}{$x=1 scope="global"}{/function}{f}{$x}

outputs nothing. I would expect it to output "1".
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sun Nov 25, 2012 3:57 pm    Post subject: Reply with quote

This is just an assignment it doen not output anything

Code:
{$x=1 scope="global"}{$x}
Back to top
View user's profile Send private message
ilyalyu
Smarty Regular


Joined: 03 Nov 2009
Posts: 72

PostPosted: Sun Nov 25, 2012 9:40 pm    Post subject: Reply with quote

Should not {$x} code output this variable?
And should it contain "1" value, since I called function {f}, which assigned $x=1 in global scope?
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Mon Nov 26, 2012 8:12 pm    Post subject: Reply with quote

This bug is now fixed in the SVN trunk.
The fix will later be included in 3.1.13
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs 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