Smarty3 中文手册


Smarty - the compiling PHP template engine

by Monte Ohrt <[email protected]> and Uwe Tews<uwe dot tews at googlemail dot com>
Publication date 2010-11-11

Table of Contents [内容列表]
Preface [序]
Preface to Translation [译序]
I. Getting Started [开始]
1. What is Smarty? [什么是Smaty?]
2. Installation [安装]
Requirements [要求]
Basic Installation [基本安装]
Extended Setup [扩展设置]
II. Smarty For Template Designers [模板设计者篇]
3. Basic Syntax [基本语法]
Comments [注释]
Variables [变量]
Functions [函数]
Attributes [属性]
Embedding Vars in Double Quotes [双引号里嵌入变量]
Math [数学运算]
Escaping Smarty Parsing [忽略Smarty解析]
4. Variables [变量]
Variables assigned from PHP [从PHP分配的变量]
Associative arrays [关联数组]
Array indexes [数组索引]
Objects [对象]
Variable scopes [变量范围]
Variables loaded from config files [从配置文件读取的变量]
{$smarty} reserved variable [{$smarty}保留变量]
Request variables
{$smarty.ldelim}, {$smarty.rdelim}
5. Variable Modifiers [变量调节器]
capitalize [首字符大写]
cat [连接字符串]
count_characters [字符计数]
count_paragraphs [计算段数]
count_sentences [计算句数]
count_words [计算词数]
date_format [格式化日期]
default [默认值]
escape [转义]
indent [缩进]
lower [小写]
nl2br [换行符替换成 <br />]
regex_replace [正则替换]
replace [替换]
spacify [插空]
string_format [字符串格式化]
strip [去除(多余空格)]
strip_tags [去除html标签]
truncate [截取]
upper [大写]
wordwrap [行宽约束]
6. Combining Modifiers [组合调节器]
7. Built-in Functions [内置函数]
8. Custom Functions [自定义函数]
9. Config Files [配置文件]
10. Debugging Console [调试控制台]
III. Smarty For Programmers [程序员篇]
11. Constants [常量]
SMARTY_DIR [Smarty目录]
12. Smarty Class Variables [smarty类变量]
$template_dir [模板目录变量]
$compile_dir [编译目录变量]
$config_dir [配置目录变量]
$plugins_dir [插件目录变量]
$debugging [调试变量]
$debug_tpl [调试模板]
$debugging_ctrl [调试控制变量]
$auto_literal [自动忽略解析]
$autoload_filters [自动加载过滤器变量]
$compile_check [编译检查变量]
$force_compile [强迫编译变量]
$caching [缓存变量]
$cache_dir [缓存目录变量]
$cache_lifetime [缓存生存周期变量]
$cache_handler_func [缓存处理函数变量]
$cache_modified_check [缓存修改检查变量]
$config_overwrite [配置.覆盖变量]
$config_booleanize [配置.布尔型变量]
$config_read_hidden [配置.读取隐藏变量]
$config_fix_newlines [配置.固定换行符变量]
$default_template_handler_func [默认模板处理函数变量]
$php_handling [php处理变量]
$trusted_dir [信任目录变量]
$left_delimiter [左定界符变量]
$right_delimiter [右定界符变量]
$compiler_class [编译类变量]
$request_vars_order [变量顺序变量]
$request_use_auto_globals [自动全局变量]
$compile_id [编译id变量]
$use_sub_dirs [子目录变量]
$default_modifiers [默认调节器变量]
$default_resource_type [默认源类型变量]
13. Smarty Class Methods() [Smarty类方法]
append() [添加]
appendByRef() [引用添加]
assign() [赋值]
assignByRef() [引用赋值]
clearAllAssign() [清除所有赋值]
clearAllCache() [清除所有缓存]
clearAssign() [清除赋值]
clearCache() [清除缓存]
clearCompiledTpl() [清除已编译模板]
clearConfig() [清除配置]
compileAllConfig() [编译所有配置]
compileAllTemplates() [编译所有模板]
configLoad() [加载配置]
createData() [建立数据对象]
createTemplate() [建立模板对象]
disableSecurity() [关闭安全]
display() [显示]
enableSecurity() [开启安全]
fetch() [获取输出内容]
getConfigVars() [获取配置变量值]
getRegisteredObject() [获取已注册的对象]
getTags() [获取标签]
getTemplateVars() [获取模板变量的值]
isCached() [是否已被缓存]
loadFilter() [加载过滤器]
registerFilter() [注册过滤器]
registerPlugin() [注册插件]
registerObject() [注册对象]
registerResource() [注册资源]
templateExists() [模板是否存在]
unregisterFilter() [注销过滤器]
unregisterPlugin() [注销插件]
unregisterObject() [注销对象]
unregisterResource() [注销资源]
testInstall() [安装测试]
14. Caching [缓存]
Setting Up Caching [建立缓存]
Multiple Caches Per Page [多重缓存]
Cache Groups [缓存集合]
Controlling Cacheability of Plugins' Output [控制插件输出的可缓存性]
15. Advanced Features [高级特性]
Security [安全]
Changing settings by template [通过模板更改设置]
Template Inheritance [模板继承]
Streams [数据流]
Objects [对象]
Static Classes [静态类]
Prefilters [预过滤器]
Postfilters [后过滤器]
Output Filters [输出过滤器]
Cache Handler Function [缓存处理函数]
Resources [资源]
Templates from $template_dir [$template_dir定义的模板]
Templates from any directory [从任何目录导入的模板]
Templates from strings [字符串定义的模板]
Template inheritance defined by PHP script [php定义的模板继承]
Templates from other sources [从其它资源引入的模板]
Default template handler function [默认模板处理函数]
16. Extending Smarty With Plugins [以插件扩展Smarty]
How Plugins Work [插件如何工作]
Naming Conventions [命名约定]
Writing Plugins [编写插件]
Template Functions [模板函数]
Modifiers [调节器]
Block Functions [块函数]
Compiler Functions [编译函数]
Prefilters/Postfilters [预滤器/后滤器]
Output Filters [输出过滤器]
Resources [资源]
Inserts [插入]
IV. Appendixes [附录]
17. Troubleshooting [疑难解答]
Smarty/PHP errors [Smarty/PHP 错误]
18. Tips & Tricks [使用技巧和经验]
Blank Variable Handling [空白变量处理]
Default Variable Handling [默认变量处理]
Passing variable title to header template [传递变量标题给头模板]
Dates [日期]
Componentized Templates [组件化模板]
Obfuscating E-mail Addresses [拒绝电子邮件地址]
19. Resources [相关资源]
20. BUGS [漏洞]
21. Smarty3.0.x Installation Package [3.0安装包]
SMARTY2_BC_NOTES [2.x版本升级至3.x版本的提示]
README [3.0.x使用指南]
22. LIST 翻译人员列表