-
language.modifiers
...ers *} {$title|truncate:40:"..."} {* apply modifier to a function parameter *} {...
-
tips.dates
...09 {$startDate|date_format:"%Y/%m/%d"} This will output: 2009/01/04 Dates can be...
-
api.template.exists
-
language.syntax.functions
...s like so: {funcname attr1="val1" attr2="val2"} . Example 3.3. function sy...
-
advanced.features.template.inheritance
...block name=head} link href="/css/mypage.css" rel="stylesheet" type="text/css"/ s...
-
language.syntax.attributes
...ibute syntax {include file="header.tpl"} {include file="header.tpl" nocache} // ...
-
language.function.eval
...nsider using {include file="string:{$template_code}"} instead. This may cache th...
-
language.basic.syntax
...edundant *} {* select name="company" {html_options options=$vals selected=$selec...
-
tips
-
tips.passing.vars
-
appendixes
-
language.function.block
...tml head title {block name="title"}Default Title{/block} /title title {block "ti...
-
language.modifier.escape
...ty- assign('articleTitle', "'Stiff Opposition Expected to Casketless Funeral Pla...
-
language.config.variables
...e - foo.conf : pageTitle = "This is mine" bodyBgColor = '#eeeeee' tableBorderSiz...
-
index
-
language.function.include
...tact.tpl' *} {include file="$tpl_name.tpl"} {* using shortform file attribute *}...
-
language.modifier.default
-
language.function.html.select.time
... would output: select name="Time_Hour" option value="00" 00 /option option value...
-
installing.smarty.basic
...e('SMARTY_DIR',str_replace("\\","/",getcwd()).'/includes/Smarty-v.e.r/libs/'); r...
-
charset
-
variable.smarty.debug.id
-
variable.cache.lifetime
-
plugins.outputfilters
-
api.get.tags
-
api.unregister.plugin
...e plugin. Valid values are "function", "block", "compiler" and "modifier". name ...
-
language.function.php
-
language.modifier.truncate
...{$articleTitle|truncate:30:""} {$articleTitle|truncate:30:"---"} {$articleTitle|...
-
variable.cache.locking
-
variable.cache.dir
-
variable.default.resource.type
-
language.modifier.spacify
...fy} {$articleTitle|spacify:"^^"} Will output: Something Went Wrong in Jet Crash,...
-
language.variables.smarty
...e} {* display the variable "page" from a form ($_POST['page']) *} {$smarty.post....
-
language.modifier.count.sentences
-
api.test.install
-
smarty.for.designers
-
language.syntax.variables
... {$foo.bar} -- display the "bar" key value of an array, similar to PHP $foo['bar...
-
api.assign.by.ref
-
language.function.html.select.date
...s will output: select name="Date_Month" option value="1" January /option option ...
-
language.variable.scopes
-
variable.escape.html
... same as {$variable|escape:"html"} . Template designers can choose to selectivel...
-
api.create.template
-
language.escaping
... to Smarty script language="javascript" var foo = !--{$foo}-- ; function dosomet...
-
variable.trusted.dir
-
variable.plugins.dir
-
language.function.nocache
-
variable.config.read.hidden
-
api.append.by.ref
-
variable.use.sub.dirs
-
language.modifier.regex.replace
...ty- assign('articleTitle', "Infertility unlikely to\nbe passed on, experts say."...
-
variable.config.dir
-
variable.compile.id
-
caching
-
language.modifier.replace
...ty- assign('articleTitle', "Child's Stool Great for Use in Garden."); ? Where te...
-
variable.default.modifiers
...default, use array('escape:"htmlall"') . To make a variable exempt from default ...
-
language.syntax.quotes
...gned variables embedded in "double quotes" so long as the variable name contains...
-
variable.compiler.class
-
api.set.template.dir
-
variable.debugging.ctrl
-
language.custom.functions
-
inforesources
-
api.register.default.plugin.handler
-
language.modifier.lower
-
api.is.cached
-
getting.started
-
language.function.for
-
variable.template.dir
-
language.builtin.functions
... array element {$user.name="Bob"} Example 7.4. Assignment of an multidimen...
-
smarty.constants
-
advanced.features
...e template. The default is "true". $allow_super_globals is a boolean flag which ...
-
language.function.html.table
...able_attr string No border="1" Attributes for table tag th_attr string No empty ...
-
resources.string
...rty template {include file="string:$template_string"} {* compiles for later reus...
-
plugins
-
advanced.features.template.settings
-
bugs
-
language.function.foreach
...{foreach from=$myarray key="mykey" item="myitem"} is still supported. {foreach} ...
-
plugins.prefilters.postfilters
...\w+)[^ ]+ !e', 'strtolower("$1")', $source); } ? Example 18.8. postfilter ...
-
caching.custom
...API allows you to turn any "dumb" KeyValue-Store (like APC, Memcache, …) i...
-
language.function.html.checkboxes
...l output: label input type="checkbox" name="id[]" value="1000" / Joe Schmoe /lab...
-
chapter.debugging.console
-
api.get.config.vars
-
language.function.extends
-
api.unregister.filter
...e filter. Valid values are "pre", "post", "output" and "variable". callback defi...
-
variable.config.booleanize
-
api.config.load
-
troubleshooting
...: unable to read resource: "index.tpl" in... or Warning: Smarty error: unable to...
-
api.functions
-
plugins.block.functions
-
variable.php.handling
-
language.combining.modifiers
...|lower|spacify|truncate:30:". . ."} The above example will output: Smokers are P...
-
preface
...e first camp exclaims that "PHP is a template engine". This approach simply mixe...
-
variable.locking.timeout
-
plugins.writing
-
language.math
...+10+$b+10)} {$foo|truncate:"`$fooTruncCount/$barTruncFactor-1`"} {assign var="fo...
-
variable.caching.type
-
variable.cache.modified.check
-
api.get.template.vars
-
advanced.features.static.classes
-
api.unregister.object
-
variable.caching
-
advanced.features.outputfilters
...er $smarty- registerFilter("output","protect_email"); $smarty- display("index.tp...
-
plugins.inserts
...format'])) { trigger_error("insert time: missing 'format' parameter"); return; }...
-
smarty.for.programmers
-
language.modifier.upper
...ty- assign('articleTitle', "If Strike isn't Settled Quickly it may Last a While....
-
variable.right.delimiter
-
plugins.resources
...urce`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}'); /pr...
-
language.modifier.wordwrap
...fault is a carriage return "\n" . By default, wordwrap will attempt to wrap at a...
-
variable.debug_template
-
api.clear.assign
-
language.modifier.strip
...ty- assign('articleTitle', "Grandmother of\neight makes\t hole in one."); $smart...
-
variable.autoload.filters
-
api.get.template.dir
-
caching.cacheable
... be disabled by adding the "nocache" option flag to the tag. Example 15.11.Â...
-
what.is.smarty
-
bc
-
caching.groups
...; // clear all caches with "sports" as the first cache_id group. This would // i...
-
api.assign
-
language.function.if
.... {/if} {* an example with "or" logic *} {if $name eq 'Fred' or $name eq 'Wilma'...
-
variable.compile.dir
-
api.add.plugins.dir
-
language.variables
...s[row].Phone} body bgcolor="{#bgcolor#}" Note An easy way to examine assigned Sm...
-
advanced.features.postfilters
...mplate $template) { return " ?php echo \" !-- Created by Smarty! -- \n\"; ? \n"....
-
api.set.cache.dir
-
language.modifier.unescape
...ty- assign('articleTitle', "Germans use quot; Uuml;mlauts quot; and pay in euro;...
-
plugins.naming.conventions
-
api.fetch
...smarty- assign('login_url',"http://{$_SERVER['SERVER_NAME']}/login"); mail($cont...
-
resources.extends
... an inheritance chain, its "don't save a compile file" property is superseeded b...
-
api.compile.all.config
...nfig files. The default is ".conf". force is an optional boolean which controls ...
-
api.register.filter
...e filter. Valid values are "pre", "post", "output" and "variable". callback defi...
-
variable.debugging
-
api.display
...bsolute filepath (MUST use "file:" prefix) $smarty- display('file:C:/www/pub/tem...
-
api.get.compile.dir
-
language.function.assign
...8. {assign} {assign var="name" value="Bob"} {assign "name" "Bob"} {* short-ha...
-
caching.multiple.caches
...; // clear all caches with "sports" as the $cache_id $smarty- clearCache(null,'s...
-
language.function.literal
-
language.function.html.radios
...l output: label input type="radio" name="id" value="1000" / Joe Schmoe /label br...
-
resources.custom
...urce`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}'); /pr...
-
config.files
...obal variables pageTitle = "Main Menu" bodyBgColor = #000000 tableBgColor = #000...
-
api.register.object
-
plugins.compiler.functions
..., Smarty $smarty) { return " ?php\necho '" . $smarty- _current_file . " compiled...
-
api.get.cache.dir
-
api.unregister.resource
-
installing.smarty.extended
-
language.modifier.string.format
...er} {$number|string_format:"%.2f"} {$number|string_format:"%d"} Will output: 23....
-
api.set.config.dir
-
api.append
-
variable.force.compile
-
variable.default.config.type
-
tips.componentized.templates
-
api.register.resource
-
resources.streams
... a template. {include file="foo:bar.tpl"} Prev  Up  Next String Template...
-
api.load.filter
-
api.unregister.cacheresource
-
api.get.registered.object
-
language.modifier.strip.tags
...ty- assign('articleTitle', "Blind Woman Gets font face=\"helvetica\" New Kidney ...
-
language.modifier.indent
... use to indent with eg use "\t" for a tab. Parameter Position Type Required Defa...
-
language.modifier.count.characters
-
api.add.config.dir
-
variable.default.config.handler.func
... $type resource type (e.g. "file", "string", "eval", "resource") * @param string...
-
advanced.features.objects
-
api.compile.all.templates
...late files. The default is ".tpl". force is an optional boolean which controls i...
-
api.clear.compiled.tpl
-
language.modifier.count.paragraphs
...ty- assign('articleTitle', "War Dims Hope for Peace. Child's Death Ruins Couple'...
-
plugins.functions
...s['var'])) { trigger_error("assign: missing 'var' parameter"); return; } if (!in...
-
language.function.while
-
variable.default.template.handler.func
... $type resource type (e.g. "file", "string", "eval", "resource") * @param string...
-
api.get.plugins.dir
-
language.modifier.date.format
...} {$smarty.now|date_format:"%D"} {$smarty.now|date_format:$config.date} {$yester...
-
variable.left.delimiter
-
language.function.include.php
...' from=$navigation} a href="{$nav.url}" {$nav.name} /a br / {/foreach} See also ...
-
variable.auto.literal
-
api.enable.security
-
variable.config.overwrite
...e=r loop=$rows} tr bgcolor="{cycle values=#rowColors#}" td ....etc.... /td /tr {...
-
api.disable.security
-
language.function.section
...ll, email from contacts ' ."where name like '$foo%' "; $smarty- assign('contacts...
-
api.add.template.dir
-
resources
...lt_resource_type (default: "file") is assumed. File Template Resources Smarty sh...
-
variable.compile.check
-
language.function.ldelim
...Javascript script language="JavaScript" function foo() {ldelim} ... code ... {rd...
-
api.variables
-
language.function.insert
...g a banner *} {insert name="getBanner" lid=#banner_location_id# sid=#site_id#} {...
-
tips.wap
...insert name=header content="Content-Type: text/vnd.wap.wml"} ?xml version="1.0"?...
-
language.function.call
...ame=menu level=0} ul class="level{$level}" {foreach $data as $entry} {if is_arra...
-
api.clear.config
-
api.register.cacheresource
-
language.function.function
... {* short-hand *} ul class="level{$level}" {foreach $data as $entry} {if is_arra...
-
variable.use.include.path
...include_path. That means a ".:" within your include path will trigger the curren...
-
language.function.capture
...displayed *} {capture name="banner"} {capture "banner"} {* short-hand *} {includ...
-
api.set.compile.dir
-
language.modifier.count.words
-
api.clear.all.cache
-
language.modifier.nl2br
...ifiers  Next nl2br All "\n" line breaks will be converted to html br / tags ...
-
installation
-
api.create.data
-
variable.error.reporting
-
variable.direct.access.security
-
variable.force.cache
-
plugins.modifiers
-
variable.merge.compiled.includes
-
api.register.plugin
...e plugin. Valid values are "function", "block", "compiler" and "modifier". name ...
-
api.register.class
...hp class Bar { $property = "hello world"; } $smarty = new Smarty(); $smarty- reg...
-
api.clear.cache
-
api.clear.all.assign
-
api.set.plugins.dir
-
api.mute.expected.errors
-
language.modifier.cat
...ty- assign('articleTitle', "Psychics predict world didn't end"); ? Where templat...
-
api.get.config.dir
-
advanced.features.prefilters
...ate) { return preg_replace("/ !--#.*-- /U",'',$tpl_source); } // register the pr...
-
variable.compile.locking
-
variable.cache.id
-
language.function.html.options
...mple would be: select name="foo" option value="1800" Joe Schmoe /option option v...
-
language.function.config.load
...obal variables pageTitle = "Main Menu" bodyBgColor = #000000 tableBgColor = #000...
-
tips.default.var.handling
... it now contains the value "no title" when you use it *} {$title} See also defau...