Skip to content
Smarty 4 中文文档
高级特性 {/programmers/advanced-features/}
Initializing search
Smarty 4 文档
特性
入门指南
理念
Appendixes
Designers
Programmers
Smarty 4 中文文档
Smarty 4 文档
特性
入门指南
理念
Appendixes
Appendixes
技巧与窍门
故障排查
Designers
Designers
调试控制台
配置文件
组合修饰符
Language basic syntax
Language basic syntax
基本语法
转义 Smarty 解析
数学运算
属性
注释
函数
在双引号中嵌入变量
变量
Language builtin functions
Language builtin functions
内置函数
{append}
{assign}, {$var=...}
Language function block
{call}
{capture}
{config_load}
{debug}
Language function extends
{for}
{foreach},{foreachelse}
{function}
{if},{elseif},{else}
Language function include
{insert}
{ldelim}, {rdelim}
{literal}
{nocache}
{section}, {sectionelse}
{setfilter}
{strip}
{while}
Language custom functions
Language custom functions
自定义函数
{counter}
{cycle}
{debug}
{eval}
{fetch}
{html_checkboxes}
{html_image}
{html_options}
{html_radios}
{html_select_date}
Language function html select time
Language function html table
Language function mailto
Language function math
Language function textformat
Language modifiers
Language modifiers
变量修饰符
capitalize
cat
count_characters
count_paragraphs
count_sentences
count_words
date_format
default
escape
from_charset
indent
lower
nl2br
regex_replace
replace
spacify
string_format
strip_tags
strip
to_charset
truncate
unescape
upper
wordwrap
Language variables
Language variables
变量
从 PHP 分配的变量
从配置文件加载的变量
变量作用域
{$smarty} 保留变量
Programmers
Programmers
高级特性 {/programmers/advanced-features/}
高级特性 {/programmers/advanced-features/}
Table of contents
目录
Smarty 类方法 {/programmers/api-functions/}
Smarty 类变量 {#api.variables}
缓存
字符集编码 {#charset}
通过插件扩展 Smarty {#plugins}
资源
常量 {#smarty.constants}
Advanced features
Advanced features
对象 {/programmers/advanced-features/.objects}
输出过滤器 {/programmers/advanced-features/.outputfilters}
后处理过滤器 {/programmers/advanced-features/.postfilters}
预过滤器 {/programmers/advanced-features/.prefilters}
安全性 {/programmers/advanced-features/.security}
静态类 {/programmers/advanced-features/.static.classes}
流 {/programmers/advanced-features/.streams}
模板继承 {/programmers/advanced-features/.template.inheritance}
通过模板更改设置 {/programmers/advanced-features/.template.settings}
Api functions
Api functions
Api add config dir
Api add plugins dir
Api add template dir
Api append by ref
Api append
Api assign by ref
Api assign
Api clear all assign
Api clear all cache
Api clear assign
Api clear cache
Api clear compiled tpl
Api clear config
Api compile all config
Api compile all templates
Api config load
Api create data
Api create template
Api disable security
Api display
Api enable security
Api fetch
Api get cache dir
Api get compile dir
Api get config dir
Api get config vars
Api get plugins dir
Api get registered object
Api get tags
Api get template dir
Api get template vars
Api is cached
Api load filter
Api mute expected errors
Api register cacheresource
Api register class
Api register default plugin handler
Api register filter
Api register object
Api register plugin
Api register resource
Api set cache dir
Api set compile dir
Api set config dir
Api set plugins dir
Api set template dir
Api template exists
Api test install
Api unregister cacheresource
Api unregister filter
Api unregister object
Api unregister plugin
Api unregister resource
Api variables
Api variables
\$allow_php_templates {#variable.allow.php.templates}
\$auto_literal {#variable.auto.literal}
\$autoload_filters {/programmers/api-variables/variable-autoload-filters/}
\$cache_dir {/programmers/api-variables/variable-cache-dir/}
\$cache_id {#variable.cache.id}
\$cache_lifetime {/programmers/api-variables/variable-cache-lifetime/}
\$cache_locking {/programmers/api-variables/variable-cache-locking/}
\$cache_modified_check {/programmers/api-variables/variable-cache-modified-check/}
\$caching_type {/programmers/api-variables/variable-caching/.type}
\$caching {/programmers/api-variables/variable-caching/}
\$compile_check {/programmers/api-variables/variable-compile-check/}
\$compile_dir {/programmers/api-variables/variable-compile-dir/}
\$compile_id {/programmers/api-variables/variable-compile-id/}
\$compile_locking {#variable.compile.locking}
\$compiler_class {#variable.compiler.class}
\$config_booleanize {#variable.config.booleanize}
\$config_dir {/programmers/api-variables/variable-config-dir/}
\$config_overwrite {#variable.config.overwrite}
\$config_read_hidden {#variable.config.read.hidden}
\$debug_tpl {/designers/chapter-debugging-console/}
\$debugging_ctrl {/programmers/api-variables/variable-debugging/.ctrl}
\$debugging {/programmers/api-variables/variable-debugging/}
\$default_config_handler_func {#variable.default.config.handler.func}
\$default_config_type {#variable.default.config.type}
\$default_modifiers {#variable.default.modifiers}
\$default_resource_type {/programmers/api-variables/variable-default-resource-type/}
\$default_template_handler_func {#variable.default.template.handler.func}
\$direct_access_security {#variable.direct.access.security}
\$error_reporting {#variable.error.reporting}
\$escape_html {#variable.escape.html}
\$force_cache {#variable.force.cache}
\$force_compile {/programmers/api-variables/variable-force-compile/}
\$left_delimiter {/programmers/api-variables/variable-left-delimiter/}
\$locking_timeout {/programmers/api-variables/variable-locking-timeout/}
\$merge_compiled_includes {#variable.merge.compiled.includes}
\$plugins_dir {/programmers/api-variables/variable-plugins-dir/}
\$right_delimiter {/programmers/api-variables/variable-right-delimiter/}
\$smarty_debug_id {/programmers/api-variables/variable-smarty-debug-id/}
\$template_dir {/programmers/api-variables/variable-template-dir/}
\$trusted_dir {#variable.trusted.dir}
\$use_include_path {/programmers/api-variables/variable-use-include-path/}
\$use_sub_dirs {/programmers/api-variables/variable-use-sub-dirs/}
Caching
Caching
控制输出的可缓存性 {/programmers/caching/caching-cacheable/}
自定义缓存实现 {/programmers/caching/caching-custom/}
缓存分组 {/programmers/caching/caching-groups/}
每页多个缓存 {/programmers/caching/caching-multiple-caches/}
设置缓存 {#caching.setting.up}
Plugins
Plugins
区块函数 {/programmers/plugins/plugins-block-functions/}
编译器函数 {/programmers/plugins/plugins-compiler-functions/}
模板函数 {/programmers/plugins/plugins-functions/}
插件的工作方式 {#plugins.howto}
插入 {/programmers/plugins/plugins-inserts/}
修饰器 {/programmers/plugins/plugins-modifiers/}
命名规则 {#plugins.naming.conventions}
输出过滤器 {/programmers/plugins/plugins-outputfilters/}
预处理/后处理 {/programmers/plugins/plugins-prefilters-postfilters/}
资源 {/programmers/plugins/plugins-resources/}
编写插件 {#plugins.writing}
Resources
Resources
自定义模板资源 {#resources.custom}
扩展模板资源 {/programmers/resources/resources-extends/}
文件模板资源 {/programmers/resources/resources-file/}
流模板资源 {#resources.streams}
字符串模板资源 {/programmers/resources/resources-string/}
资源 {#resasdources}
Table of contents
目录
高级特性 {/programmers/advanced-features/}
目录
安全性
通过模板更改设置
模板继承
流
对象
静态类
预过滤器
后过滤器
输出过滤器
Back to top