List Info

Thread: Re: Curly braces inside a function argument




Re: Curly braces inside a function argument
user name
2007-08-21 14:41:38
--- Ben Davis <bendavis78gmail.com> wrote:
> How can put curly braces inside of a function argument?
 Is it not
> possible?  everything I've tried doesn't seem to work:
> 
> {myfunc test="foo "}
> {myfunc test='foo '}
> {myfunc test="foo bar"}
> 
> No matter what, smarty always percieves the first
closing brace as the
> closing brace for the function itself.   Should this be
considered a bug?

Hi.

It is a limitation of the parser. There are two ways that I
can think of off
the top of my head to do this, but I suggest the latter:

1) use an assigning  block to embed an
/ into a static
text block;

2) use the $smarty.ldelim and $smarty.rdelim can be used.
Just remember the
syntax for embedding vars in quotes:
http://smarty.php.net/manual/en/language.syntax.quotes
.php

eg: {myfunc test="foo
`$smarty.ldelim`bar`$smarty.rdelim`"}

hope that helps



       
____________________________________________________________
________________________
Be a better Heartthrob. Get better relationship answers from
someone who knows. Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=3965454
33

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )