Re: [SMARTY] Curly braces inside a function argument

From: Date: Tue, 21 Aug 2007 19:41:38 +0000
Subject: Re: [SMARTY] Curly braces inside a function argument
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-13751@lists.php.net to get a copy of this message
--- Ben Davis <bendavis78@gmail.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 {bar}"} > {myfunc test='foo {bar}'} > {myfunc test="foo {ldelim}bar{rdelim}"} > > 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 {capture} block to embed an {ldelim}/{rdelim} 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.ldelimbar$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=396545433

« previous php.smarty.general (#13751) next »