In template I have two strings which I want to combine in one.
{assign var="bigUrl" value="Search?开发者_StackOverflowsearchFor=Member&{$searchUrl}"}
To be able to use variable {$bigUrl}
below in template, like this:
<a href={$bigUrl}>Link</a>
When I write mentioned assignment smarty compiler report error:
syntax error: invalid attribute name: '='
You can't use braces inside smarty tags. Just remove them:
{assign var="bigUrl" value="Search?searchFor=Member&$searchUrl"}
Or use cat
filter:
{$bigUrl|cat:$searchUrl}
I'm not sure this is it, but in the Smarty manual all {assign}s are in single quotes. The error message would make sense if those don't work.
Can you try replacing the double quotes?
精彩评论