Home > Archive > PHP Smarty Templates > May 2004 > Re: [SMARTY] A Small Bug? Please advise...
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [SMARTY] A Small Bug? Please advise...
|
|
| Monte Ohrt 2004-05-06, 11:09 pm |
| The debug console only shows the variables assigned when display() is
called, not anything assigned during execution of the template. You can
see the currently assigned vars by using {debug} inside the template
after your assignment.
Alex wrote:
> Hi,
>
> while developing smarty functions for my CMS I have stumbled a small
> bug, that does not affect operation of smarty, but causes some pain
> for the web developer. The bug concerns the debug console.
>
> In my system, I have tempaltes nestes inside each other (duh!), for
> example like this
>
> index.htm (0.11989)
> langs.en [] global (0.00329)
> article.htm (0.06870)
> ratings.html (0.02205)
> langs.en [ratings] global (0.00475)
>
> Now, I also have written some smarty functions to load some CMS
> specific data, the function is called in ratings.html with a tag like
> this
>
> {keywords max=5 var=keywords}
>
> The functions works like a charm, fetching a set of keywords from the
> database and passing them to a smarty variable called "keywords" in
> form of an array. Wonderful. The problem is, however, that the debug
> console does not display the $keywords array, although smarty has it,
> as I can access it in the template and outout it =(( Nonetheless, if I
> call the very smae function from the top level templates index.html,
> then $keywords pop up in the debug console.
>
> This behaviour can be tested with a simple {assign var=foo value=bar}
> function with a set of nested templates.
>
> Please advise it is my bad, or really a bug that needs fixing =) I am
> searching for a solution myself, but this may take a while,
>
> best regards,
>
> Alex
>
| |
|
| In there maybe a quick hack to override this behaviour?
regards,
alex
Monte Ohrt wrote:
> The debug console only shows the variables assigned when display() is
> called, not anything assigned during execution of the template. You can
> see the currently assigned vars by using {debug} inside the template
> after your assignment.
>
> Alex wrote:
>
>
| |
|
| Moreover, this method fails in case debugging is already activated,
please advise =)
best regards and thanks,
alex
Monte Ohrt wrote:
> The debug console only shows the variables assigned when display() is
> called, not anything assigned during execution of the template. You can
> see the currently assigned vars by using {debug} inside the template
> after your assignment.
>
> Alex wrote:
>
>
|
|
|
|
|