您好,欢迎光临本网站![请登录][注册会员]  
文件名称: smarty中文手册.pdf
  所属分类: Web开发
  开发工具:
  文件大小: 1mb
  下载次数: 0
  上传时间: 2010-04-26
  提 供 者: P_***
 详细说明: 一、 模板设计................................................................................................................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 [换行符替换成
].....................................................................................................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 v $global_assign [全局配置变量]..............................................................................................100 $undefined [未定义变量]........................................................................................................100 $autoload_filters [自动加载过滤器变量].............................................................................101 $compile_check [编译检查变量]............................................................................................101 $force_compile [强迫编译变量].............................................................................................101 $caching [缓存变量].................................................................................................................102 $cache_dir [缓存目录变量]......................................................................................................102 $cache_lifetime [缓存生存时间变量]....................................................................................102 $cache_handler_func [缓存处理函数变量]..........................................................................103 $cache_modified_check [缓存修正检查变量]....................................................................103 $config_overwrite [配置覆盖变量].......................................................................................103 $config_booleanize [配置布尔化变量]................................................................................103 $config_read_hidden [配置读取隐藏变量].........................................................................104 $config_fix_newlines [配置固定换行符变量]......................................................................104 $default_template_handle r_func [默认模板处理函数变量]..........................................104 $php_handling [PHP处理变量].............................................................................................104 $security [安全变量].................................................................................................................105 $secure_dir [安全目录变量]....................................................................................................106 $security_settings [安全配置变量].......................................................................................106 $trusted_dir [信任目录变量]...................................................................................................107 $left_delimiter [左结束符变量]..............................................................................................107 $right_delimiter [右结束符变量]...........................................................................................107 $compiler_class [编译类变量]................................................................................................107 vi $request_vars_order [变量顺序变量]...................................................................................107 $request_use_auto_globals [自动全局变量]......................................................................108 $compile_id [编译ID变量].......................................................................................................108 $use_sub_dirs [子目录变量]...................................................................................................108 $default_modifiers [默认修正器变量].................................................................................108 $default_resource_type [默认源类型变量].........................................................................109 11. Methods [方法].........................................................................................................................109 append [添加]............................................................................................................................109 append_by_ref [引用添加]......................................................................................................110 assign [赋值]..............................................................................................................................111 assign_by_ref [引用赋值].........................................................................................................111 clear_all_assign [清除所有赋值].............................................................................................112 clear_all_cache [清除所有缓存]..............................................................................................112 clear_assign [清除赋值]...........................................................................................................113 clear_cache [清除缓存]............................................................................................................113 clear_compiled_tpl [清除已编译模板]..................................................................................114 clear_config [清除配置]...........................................................................................................114 config_load [加载配置]............................................................................................................115 display [显示].............................................................................................................................115 fetch [取得输出的内容].............................................................................................................117 get_config_vars [取配置变量的值]........................................................................................118 get_registered_object [取得已注册的对象]........................................................................119 get_template_vars [取得模板变量的值]...............................................................................119 vii is_cached [是否已被缓存]........................................................................................................120 load_filter [加载过滤器]...........................................................................................................120 register_block [注册一个块]...................................................................................................121 register_compiler_function [注册编译函数]......................................................................122 register_function [注册函数].................................................................................................123 register_modifier [注册修饰器].............................................................................................123 register_object [注册对象].....................................................................................................124 register_outputfilter [注册输出过滤器]..............................................................................124 register_postfilter [注册提交过滤器]...................................................................................125 register_prefilter [注册预过滤器]..........................................................................................125 register_resource [注册资源].................................................................................................126 trigger_error [触发错误].........................................................................................................127 template_exists [模板是否存在]............................................................................................127 unregister_block [注销一个块]..............................................................................................127 unregister_compiler_function [注销编译函数]................................................................127 unregister_function [注销函数]............................................................................................128 unregister_modifier [注销修饰器].......................................................................................128 unregister_object [注销对象]................................................................................................128 unregister_outputfilter [注销输出过滤器].........................................................................129 unregister_postfilter [注销提交过滤器]..............................................................................129 unregister_prefilter [注销预过滤器]....................................................................................129 unregister_resource [注销资源]...........................................................................................129 12. Caching [缓存]...........................................................................................................................130 viii Setting Up Caching [建立缓存]............................................................................................130 Multiple Caches Per Page [每页多个缓存].........................................................................133 Cache Groups [缓存集合].......................................................................................................135 Controlling Cacheability of Plugins' Output [控制插件输出的缓冲能力].................136 13. Advanced Features [高级特征].............................................................................................138 Objects [对象]............................................................................................................................138 Prefilters [预过滤器].................................................................................................................140 Postfilters [后过滤器]...............................................................................................................141 Output Filters [输出过滤器]...................................................................................................141 Cache Handler Function [缓冲处理函数]...........................................................................142 Resources [资源].......................................................................................................................145 14. Extending Smarty With Plugins [利用插件扩展Smarty]..............................................149 How Plugins Work [插件如何工作]......................................................................................150 Naming Conventions [命名约定].........................................................................................151 Writing Plugins [编写插件]....................................................................................................152 Template Functions [模板函数插件]....................................................................................153 Modifiers [修正器插件]............................................................................................................155 Block Functions [区块函数插件]...........................................................................................156 Compiler Functions [编译函数插件]....................................................................................158 Prefilters/Postfilters [预滤器/补滤器插件].........................................................................159 Output Filters [输出过滤插件]...............................................................................................161 Resources [资源插件]...............................................................................................................162 Inserts [嵌入插件].....................................................................................................................164 ix 三、 Appendixes [附录].........................................................................................165 15. Troubleshooting [疑难解答]..................................................................................................165 Smarty/PHP errors [错误].....................................................................................................165 16. Tips & Tricks [使用技巧和经验].............................................................................................167 Blank Variable Handling[空白变量处理]............................................................................167 Default Variable Handling[默认变量处理].........................................................................167 Passing variable title to header template[传递变量型标题给头模板].......................168 Dates[日期]................................................................................................................................169 WAP/WML[WAP/WML]........................................................................................................170 Componentized Templates[组合的模板]...........................................................................171 Obfuscating E-mail Addresses[拒绝电子邮件地址]........................................................173 17. Resources [相关资源]...............................................................................................................174 18. BUGS [漏洞]...............................................................................................................................174 ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 输入关键字,在本站1000多万海量源码库中尽情搜索: