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

debugging window <=> var scope

 
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
gyopee
Smarty Rookie


Joined: 27 Jan 2014
Posts: 14

PostPosted: Wed Jan 29, 2014 7:37 am    Post subject: debugging window <=> var scope Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Wed Jan 29, 2014 8:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
gyopee
Smarty Rookie


Joined: 27 Jan 2014
Posts: 14

PostPosted: Thu Jan 30, 2014 6:36 am    Post subject: Reply with quote

Okay, thank you.
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