smarty 模板包含
来源:互联网 发布:js array.join 编辑:程序博客网 时间:2024/05/09 14:44
Example 7-6. function include
Smarty手册范例 7-6. include 函数演示
{include file="header.tpl"}{* body of template goes here *}{include file="footer.tpl"}
You can also pass variables to included templates as attributes. Any variables explicitly passed to an included template as attributes are only available within the scope of the included file. Attribute variables override current template variables, in the case they are named alike.
可以在属性中传递参数给待包含模板. 传递给待包含模板的参数只在待包含模板中可见. 如果传递的参数在待包含模板中有同名变量,那么该变量被传递的参数替代.
Example 7-7. function include passing variables
Smarty手册范例 7-7. 带传递参数的 include 函数演示
{include file="header.tpl" title="Main Menu" table_bgcolor="#c0c0c0"}{* body of template goes here *}{include file="footer.tpl" logo="http://my.domain.com/logo.gif"}
Use the syntax for template resources to include files outside of the $template_dir directory.
包含 $template_dir 文件夹之外的模板请使用 模板资源 说明的格式.
Example 7-8. function include template resource examples
Smarty手册范例 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"}
- smarty 模板包含
- >+ smarty 模板
- smarty 模板
- smarty模板
- smarty模板
- smarty模板
- smarty模板
- smarty模板
- smarty 模板
- smarty模板
- smarty模板
- smarty模板
- smarty模板
- Smarty模板
- smarty模板
- smarty模板
- smarty模板
- 【smarty】smarty模板变量调节器
- java切割图片并存入sqlite数据库中
- 光照设置之我见
- 字符串转换成整数
- poj_3358_Period of an Infinite Binary Expansion
- 简单工厂模式
- smarty 模板包含
- 全排列
- Android应用开发者应注意的十项
- 图解GIT
- java学习二
- linux后台执行
- 遍历、显示ftp下的文件夹和文件信息
- 开关电源中的打嗝保护现象
- UIScrollView 滚动视图 (实例)