{$mouseOver = "test"}
{$mouseOver .= " continue"}
就像我能做到这一点简单的PHP:
$test = "Hello";
$test .= " continue";
echo $test; // will output: Hello continue
在Smarty的PHP模板。我该如何做对吗?
{$mouseOver = "test"}
{$mouseOver .= " continue"}
就像我能做到这一点简单的PHP:
$test = "Hello";
$test .= " continue";
echo $test; // will output: Hello continue
在Smarty的PHP模板。我该如何做对吗?
v2p是在正确的轨道上,但具体情况,你会做像这样:
{assign var="varname" value="Hello"}
{assign var="varname" value="{$varname} World"}
{$varname}
这将打印“Hello World”,并且$varname
将继续保留该值直到进一步修改。
尝试{assign var='name' value='some value'}
见http://www.smarty.net/docsv2/en/language.custom.functions.tpl#language.function.assign
什么字符串连接,使用cat
修改