|
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 |
mutant Smarty Rookie
Joined: 11 May 2004 Posts: 7
|
Posted: Sat Aug 14, 2004 6:28 pm Post subject: Temporarily change delimiter?? |
|
|
Hello,
My smarty object uses a custom set of delimiters "{{", "}}". This appears to break the debug.tpl, since it is in "{", "}" format.
Is it possible to temporarily change the delimiter handling within a system?, I could see adding some code in debug.tpl to do this
debug.tpl
Code: |
{{php}}
global $smarty;
$smarty->ldelim="{";
$smarty->rdelim="}";
{{/php}}
....
|
This however didn't work.
I also tried manually placing the debug in the template:
bottom.tpl
Code: |
...
</html>
{{php}}
global $smarty;
$smarty->ldelim="{";
$smarty->rdelim="}";
{{/php}}
{debug output=html}
...
|
Again to no effect.
Whenever I tried to use the debug.tpl with alternate delimiters it doesn't work.
I've resorted to simply dumping the _tpl_vars manually, and while this works, it would be nice to know the 'real' solution.
Code: |
{{php}}
global $smarty.
vardump($smarty->_tpl_vars);
{{/php}}
|
Mucho Grassyass to anyone who can shed some light on this. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Sat Aug 14, 2004 8:38 pm Post subject: |
|
|
make your own debug.tpl (maybe just use the one from the distribution and search-and-replace the delimiters) and point $smarty->debug_tpl to it. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Sun Aug 15, 2004 12:33 am Post subject: |
|
|
What's weird to me is that core.display_debug_console.php seems to already have code in it to deal with this (it temporarily re-assigns the delimiters):
http://cvs.php.net/co.php/smarty/libs/core/core.display_debug_console.php?r=1.10
What version of Smarty are you using?
FYI: when using PHP blocks, you need not resort to globals for the Smarty object as $this will resolve to the instanced Smarty object's context:
{{php}}
vardump($this->_tpl_vars);
{{/php}} |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Sun Aug 15, 2004 2:31 pm Post subject: |
|
|
boots wrote: | What's weird to me is that core.display_debug_console.php seems to already have code in it to deal with this |
d'oh! of course. and that works for me fine, too. |
|
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
|