> Smarty模板引擎中文在线手册 > 7. Built-in Functions [内建函数]

Smarty comes with several built-in functions. Built-in functions are integral to the template language. You cannot create custom functions with the same names, nor can you modify built-in functions.

Smarty自带一些内建函数.
内建函数是模板语言的一部分.
用户不能创建名称和内建函数一样的自定义函数,也不能修改内建函数.

{insert} output. If you have caching turned on and you have {insert} commands that you expect to run within cached content, do not capture this content.


警告

当希望捕获包含 {insert} 命令的数据时要特别注意. 如果打开了缓存并希望将 {insert} 命令输出到缓存中,不要捕获该区域的数据.

Example 7-1. capturing template content
例 7-1.捕获模板内容

{* we don't want to print a table row unless content is displayed *}
{* 该例在捕获到内容后输出一行包含数据的表格,如果没有捕获到就什么也不输出 *} {capture name=banner} {include file="get_banner.tpl"} {/capture} {if $smarty.capture.banner ne ""} <tr> <td> {$smarty.capture.banner} </td> </tr> {/if}
上一篇:
下一篇: