没有合适的资源?快使用搜索试试~ 我知道了~
强大的模板引擎(php之模板引擎)
需积分: 9 7 下载量 165 浏览量
2010-03-27
00:31:03
上传
评论
收藏 1.35MB PDF 举报
温馨提示
试读
185页
强大的模板引擎,强大的模板引擎(php之模板引擎) 有兴趣的话,就了解一下
资源推荐
资源详情
资源评论
Smarty 教 程
Copyright © by ispi of Lincoln, Inc. - 05/05/2007
1
i
目 录
一、 模板设计................................................................................................................1
1. 基本语法 ................................................................................................................................................... 1
Comments [注释] ................................................................................................................................. 1
Functions [函数] ................................................................................................................................... 1
Attributes [属性]................................................................................................................................... 1
Embedding Vars in Double Quotes [双引号里值的嵌入] .......................................................... 2
Math[数学运算]...................................................................................................................................... 2
2. 变量 ........................................................................................................................................................... 3
Variables assigned from PHP [从PHP分配的变量]..................................................................... 3
Associative arrays [关联数组] ................................................................................................... 4
Array indexes[数组下标]............................................................................................................. 4
Objects[对象]................................................................................................................................. 5
Variables loaded from config files [从配置文件读取的变量].................................................... 6
{$smarty} reserved variable [{$smarty}保留变量] .................................................................... 7
Request variables[页面请求变量]............................................................................................. 7
{$smarty.now} .............................................................................................................................. 8
{$smarty.const}............................................................................................................................ 8
{$smarty.capture}........................................................................................................................ 9
{$smarty.config}.......................................................................................................................... 9
{$smarty.section}, {$smarty.foreach}................................................................................... 9
ii
{$smarty.template}..................................................................................................................... 9
3. Variable Modifiers [变量调节器] .................................................................................................... 10
capitalize [所有单词首字符大写] .............................................................................................. 10
count_characters[字符计数] .................................................................................................... 11
cat[连接字符串] ............................................................................................................................ 12
count_paragraphs[计算段数] .................................................................................................. 12
count_sentences[计算句数] ..................................................................................................... 13
count_words[计算词数]............................................................................................................. 13
date_format[格式化日期].......................................................................................................... 14
default[默认值]............................................................................................................................ 15
escape[编码]................................................................................................................................. 16
indent[缩进] ................................................................................................................................. 17
lower [小写].................................................................................................................................. 18
nl2br [换行符替换成<br />]..................................................................................................... 19
regex_replace [正则替换] ......................................................................................................... 19
replace [替换] .............................................................................................................................. 20
spacify [插空]............................................................................................................................... 21
string_format [字符串格式化].................................................................................................. 22
strip [去除(多余空格)]................................................................................................................. 22
strip_tags [去除html标签] ........................................................................................................ 23
truncate [截取] ............................................................................................................................ 24
upper [大写]................................................................................................................................. 25
wordwrap [行宽约束]................................................................................................................. 26
iii
4. Combining Modifiers [组合使用变量调节器] .............................................................................. 27
5. Built-in Functions [内建函数].......................................................................................................... 28
capture [获取页面输出].............................................................................................................. 28
config_load [配置加载].............................................................................................................. 29
foreach,foreachelse [循环处理数组]...................................................................................... 31
include [包含文件] ...................................................................................................................... 36
include_php [包含PHP脚本] .................................................................................................... 37
insert [插入函数] ......................................................................................................................... 38
if,elseif,else .................................................................................................................................. 40
ldelim,rdelim [输出分隔符]....................................................................................................... 42
literal [文本处理].......................................................................................................................... 42
php [嵌入php脚本] ..................................................................................................................... 43
section,sectionelse [遍历数组] ............................................................................................... 43
strip [去处首尾空格和回车]........................................................................................................ 55
6. Custom Functions[自定义函数] ...................................................................................................... 56
assign [为模板变量赋值] ............................................................................................................ 56
counter [计数] ............................................................................................................................. 56
cycle [轮转使用值] ....................................................................................................................... 58
debug [调试输出] ........................................................................................................................ 59
eval ................................................................................................................................................. 60
fetch [取文件、HTTP、FTP]..................................................................................................... 61
html_checkboxes [html 复选框]............................................................................................ 62
html_image [html 图片] .......................................................................................................... 64
iv
html_options [html下拉列表] ................................................................................................. 65
html_radios [html 单选框] ...................................................................................................... 67
html_select_date [html 日期下拉列表]................................................................................. 69
html_select_time [html 时间下拉列表] ................................................................................ 74
html_table [html 制表] ............................................................................................................ 79
math [数学运算]........................................................................................................................... 81
mailto ............................................................................................................................................ 82
popup_init.................................................................................................................................... 84
popup [创建javascript弹出窗口]............................................................................................. 85
textformat [文本格式化] ........................................................................................................... 91
7. Config Files [配置文件] ..................................................................................................................... 95
8. Debugging Console [调试控制台] ................................................................................................. 97
二、 Smarty For Programmers [程序员篇] .............................................................98
9. Constants [常量]................................................................................................................................. 98
SMARTY_DIR [Smarty目录] .................................................................................................... 98
10. Variables [变量]........................................................................................................................... 98
$template_dir [模板目录变量] ................................................................................................. 98
$compile_dir [编译目录变量] ................................................................................................... 98
$config_dir [配置目录变量]....................................................................................................... 99
$plugins_dir [插件目录变量]..................................................................................................... 99
$debugging [调试变量]............................................................................................................. 99
$debug_tpl [调试模板变量] .................................................................................................... 100
$debugging_ctrl [调试控制变量] .......................................................................................... 100
剩余184页未读,继续阅读
资源评论
jiewliu
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功