smarty自定义函数1
来源:互联网 发布:lua nginx api 编辑:程序博客网 时间:2024/05/17 06:32
Smarty自定义函数
作用:用于在模板被执行时为模板变量赋值
函数名称:assign
参数:var: 声明变量名称 字符串
Value: 给该变量赋值 字符串
<{assign var=”title” value=”this is title”}>
$tpl->assign(“title”,”this is title”);
实现自定义函数有两种:
1.注册自定义函数(3.*版本不支持)
$tpl->register_function(“模板文件中的函数名”,”php中的函数名”)
2. 注册块
$tpl->register_block(“模板文件中的块名”,”php中的函数名”)
自定义函数整理
Counter
<{counter start=0 skip=2 print=false}>
<{counter}<br>
<{counter}>
OUTPUT
2、4
- smarty自定义函数1
- 【smarty】smarty自定义函数
- Smarty模板技术-自定义函数-1
- 了解smarty自定义函数
- smarty自定义函数
- smarty自定义函数总结
- smarty自定义函数
- smarty自定义函数
- smarty自定义函数
- smarty自定义函数
- smarty中自定义函数
- smarty自定义函数
- smarty的自定义函数
- smarty自定义函数
- smarty 自定义函数
- SMARTY自定义函数总结
- smarty自定义函数
- smarty自定义函数
- Ubuntu下SCIM中文输入法的安装步骤
- Mercurial修改历史changeset
- javascript实现rowSpan引起的数组越界
- linux mount nfs and cifs
- Oracle 系统表等操作
- smarty自定义函数1
- 反汇编
- Linux的视频编程(v4l2编程)
- 如何让Android横竖屏切换时不销毁当前activity
- 利用哈希表实现实体类索引
- STL容器的capacity()和reserve()演示-----vector
- 关于java开发中path和classpath环境变量问题的总结
- 视频变成黑白的原因
- 如何搭建web服务器 使用Nginx搭建反向代理服务器