Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Delimiter oddness

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
dpatterson
Smarty Rookie


Joined: 12 Apr 2013
Posts: 16

PostPosted: Fri Sep 13, 2013 8:52 pm    Post subject: Delimiter oddness Reply with quote

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 Confused

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


Joined: 16 Apr 2003
Posts: 7299
Location: Lincoln Nebraska, USA

PostPosted: Fri Sep 13, 2013 9:33 pm    Post subject: Reply with quote

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


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

PostPosted: Sun Sep 15, 2013 12:35 pm    Post subject: Reply with quote

Smarty allows nesting of tags. Therefor also {{$a}} is valid.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sun Sep 15, 2013 1:18 pm    Post subject: Reply with quote

Smarty allows nesting of tags. Therefor also {{$a}} is valid.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 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