{$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
修改