cat
连接字符串

Parameter PositionTypeRequiredcatDescription
1stringNoemptyThis value to catentate to the given variable.

This value is catenated to the given variable.

将cat里的值连接到给定的变量后面.

Example 5-4. cat
例 5-4.字符串连接

index.php:



$smarty = new Smarty;

$smarty->assign('articleTitle', 'Psychics predict world didn't end');

$smarty->display('index.tpl');



index.tpl:



{$articleTitle|cat:" yesterday."}



OUTPUT:



Psychics predict world didn't end yesterday.