|
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 |
dpatterson Smarty Rookie
Joined: 12 Apr 2013 Posts: 16
|
Posted: Fri Sep 13, 2013 8:52 pm Post subject: Delimiter oddness |
|
|
Okay. I'm obviously missing something here as regards Smarty 3 delimiter handling.
Delimiters are default ({ and }).
Template variable $a = 'AAAA'
Template contains {{$a}}
I would expect the output to be {AAAA}
Actual output is AAAA (missing the surrounding braces).
Can someone explain, please
Thanks in advance
p.s. I actually came across this while trying to do some special pre-compile filtering with custom delimiters and worked back to this simple case. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Sep 13, 2013 9:33 pm Post subject: |
|
|
It will process all of the {} as braces. This is valid:
{$foo{$bar}}
so {{$a}} is likely valid too, or you would see a syntax error.
Try this:
Code: | {$smarty.ldelim}{$a}{$smarty.rdelim} |
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Sep 15, 2013 12:35 pm Post subject: |
|
|
Smarty allows nesting of tags. Therefor also {{$a}} is valid. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Sep 15, 2013 1:18 pm Post subject: |
|
|
Smarty allows nesting of tags. Therefor also {{$a}} is valid. |
|
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
|