|
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 |
gyopee Smarty Rookie
Joined: 27 Jan 2014 Posts: 14
|
Posted: Wed Jan 29, 2014 7:37 am Post subject: debugging window <=> var scope |
|
|
When I assign a variable in the template (or even in php) the debugging window always tells me that the scope of the variable is "Smarty root" even if I change the scope to global like {$var="var" scope="global"}
I'm expecting different values for scope.
What am I thinking wrong?
Last edited by gyopee on Thu Jan 30, 2014 6:37 am; edited 1 time in total |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Jan 29, 2014 8:58 pm Post subject: |
|
|
The scope attribute when assigning a variable in a template defines how far the variable shall bubble up in the template call tree.
The debug window shows where it does find the first definition of the variable after displaying the templates. It will find the bubbled up value of var in the Smarty object first. That why it shows root in the debug window |
|
Back to top |
|
gyopee Smarty Rookie
Joined: 27 Jan 2014 Posts: 14
|
Posted: Thu Jan 30, 2014 6:36 am Post subject: |
|
|
Okay, thank you. |
|
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
|