> Smarty模板引擎中文在线手册 > foreachelse

template resources to include files outside of the $template_dir directory.

包含 $template_dir 文件夹之外的模板请使用 模板资源 说明的格式.

Example 7-8. function include template resource examples
例 7-8. 使用外部模板资源的 include 函数演示

{* absolute filepath *}
{include file="/usr/local/include/templates/header.tpl"}

{* absolute filepath (same thing) *}
{include file="file:/usr/local/include/templates/header.tpl"}

{* windows absolute filepath (MUST use "file:" prefix) *}
{include file="file:C:/www/pub/templates/header.tpl"}

{* include from template resource named "db" *}
{include file="db:header.tpl"}

上一篇:
下一篇: