emphstart = <strong>
emphend = </strong>
title = Welcome to {$company}'s home page!
ErrorCity = You must supply a {#emphstart#}city{#emphend#}.
ErrorState = You must supply a {#emphstart#}state{#emphend#}.
This is the contents of foo.
Welcome to Foobar Pub & Grill's home page!
You must supply a <strong>city</strong>.
You must supply a <strong>state</strong>.
例子8-7. 另一个{eval}例子
本例将输出服务器名(大写)和IP。被赋值的变量$str可以来自一个数据库查询。
<?php $str = 'The server name is {$smarty.server.SERVER_NAME|upper} ' .'at {$smarty.server.SERVER_ADDR}'; $smarty->assign('foo',$str); ?>