
PHP通过“.”连接字符串,Java通过“+”连接字符串,smarty连接字符串如何实现呢?
查了查手册,发现:smarty连接字符串通过的是关键字:|cat:
例如:
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.[ 本帖最后由 xiexie 于 2012-7-7 14:32 编辑 ]
{assign var="h_index" value=$cur_yearmonth.year|cat:"-"|cat:$cur_yearmonth.mon|cat:"-"|cat:$day.day }
| 欢迎光临 PHP开发笔记 (http://phpvi.com/) | Powered by Discuz! 6.1.0 |