smarty: curly brackets in argument
it is a well-known problem that curly-brackets in a smarty function-argument make the script die with an error. this is because the curly-bracket is part of the smarty-tagging. unfortunately there is no escaping possible. also the {literal} is not useful, because it can only be used for document-content, like JavaScript or CSS.
example:
{$foo|regex_replace:"/^([0-9]{4})([0-9]{2})([0-9]{2})$/"
:"$3.$2.$1"}
dies with an error.
workaround:
{capture assign=foo_regex}{literal}/^([0-9]{4})([0-9]{2}
)([0-9]{2})$/{/literal}{/capture}
{$foo|regex_replace:$foo_regex:"$3.$2.$1"}
does the trick.
source:
smarty-forum-post

