|
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 |
dthought Smarty Regular
Joined: 21 Apr 2003 Posts: 55 Location: Melbourne, Australia
|
Posted: Mon Apr 21, 2003 1:41 pm Post subject: Debug console to include variables from included pages |
|
|
Hi everyone!
Probably my biggest feature at the moment would be the ability to have the debug console spit out variables included in child (included) pages.
At the moment, you only get variables for the $smarty->display('blah.tpl') page.
If you subsequently include a file, any new variables defined in there (eg. let's say you send some variables in your include statement, or set some variables via some other means) are not listed in the debug console - a very handy bit of help it would be for debugging, I think (-: |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Apr 21, 2003 1:45 pm Post subject: |
|
|
... and how should this look in the debug console? |
|
Back to top |
|
dthought Smarty Regular
Joined: 21 Apr 2003 Posts: 55 Location: Melbourne, Australia
|
Posted: Mon Apr 21, 2003 1:58 pm Post subject: |
|
|
In the same way that templates are listed in a sort of heirarchy at the top of the console, I would imagine that variables could be done the same way...
Have the name of the template as a sort of title (in the style of the line that currently says "assigned template variables:"), then its variables follow.
eg.
assigned template variables: mytemplate.tpl
{$variable1} foo
{$variable2} bar
assigned template variables: child.tpl
{$childtplvariable1} dog
assigned template variables: secondchild.tpl
{$secondchildtplvariable1} cat
and so on. Make sense?
(edited to slightly clarify how it could look) |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Apr 21, 2003 7:51 pm Post subject: |
|
|
So spit out all the assigned variables for each template? Typically the majority of variables are global, whereas some are local to a template, or introduced into the parent template or globally on-the-fly. This would make the debug console quite lengthy trying to display everything.
If you want to know what variables are available for a particular template, put {debug} somewhere in that template (like at the bottom). Then a debug table will show up in-line where that tag is placed, showing a snapshot of the currently assigned vars. This will also include any vars assigned within that template before the {debug} call.
Monte |
|
Back to top |
|
dthought Smarty Regular
Joined: 21 Apr 2003 Posts: 55 Location: Melbourne, Australia
|
Posted: Tue Apr 22, 2003 10:04 am Post subject: |
|
|
Interesting, I'll have to have a play with that.
Thanks for the tip (-: |
|
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
|