-
language.variables.smarty
...equest variables such as $_GET , $_POST , $_COOKIE , $_SERVER , $_ENV and $_SESS...
...arty} variable can be used to access several environment and request variables. ...
...ET) http://www.example.com/index.php?page=foo *} {$smarty.get.page} {* display t...
...e accessed as demonstrated in the examples below: Example 4.8. Displaying ...
... {$smarty} reserved variable {$smarty} reserved variable , ldelim, smarty, rdeli...
... reasons {$SCRIPT_NAME} is short-hand for {$smarty.server.SCRIPT_NAME} . a href=...
-
language.syntax.variables
... find your template syntax getting too complex, it may be a good idea to move th...
...variables are an exception to the $dollar syntax and are instead referenced with...
...ou can reference arrays by index numerically or non-numerically. Also reference ...
... presentation. If you find your template syntax getting too complex, it may be a...
...dollar sign. They can contain numbers, letters and underscores, much like a PHP ...
... Variables Variables variables Variables Prev  Chapter 3. Basic Syntax...
...[9,8],3]} // can be nested Short variable assignment: {$foo=$bar+2} {$foo = strl...
-
language.function.insert
...eeds to call a function to get the banner contents. Example 7.56. function...
...he output will be assigned to script string No n/a The name of the php script th...
...nd should not be used. Put your PHP logic in PHP scripts or plugin functions ins...
...reated, even within cached pages. This works good for things like banners, polls...
... {insert} {insert} , ldelim, insert, rdelim, {insert} Prev  Chapter 7.Â...
...elim, {insert} Prev  Chapter 7. Built-in Functions  Next {insert} ...
...tion_id# sid=#site_id#} {* short-hand *} In this example, we are using the name ...
-
installing.smarty.basic
... all applications and only get changed when you upgrade to a new version of Smar...
...are in the /libs/ sub directory of the distribution. These are .php files that y...
...com/ guestbook/ templates/ index.tpl templates_c/ configs/ cache/ htdocs/ index....
.../ directory. Basically, if your application can find the Smarty.class.php file, ...
... Basic Installation Basic Installation basic, installation Basic Installation Pr...
... Basic Installation Basic Installation basic, installation Basic Installation Pr...
-
language.function.append
...yer. See also append() and getTemplateVars() . Prev  Up  Next ChapterÂ...
...lacing application logic into the presentation that may be better handled in PHP...
...a The value being assigned index string No n/a The index for the new array eleme...
...ter handled in PHP. Use at your own discretion. Attributes: Attribute Name Type ...
... Chapter 7. Built-in Functions  Next {append} {append} is used for ...
... {append} {append} , ldelim, append, rdelim, {append} Prev  Chapter 7.Â...
...e' 'Bob' index='first'} {* short-hand *} {append 'name' 'Meyer' index='last'} {*...
-
api.create.template
...e pairs of variables which get assigned to the object. Example 14.18. crea...
...ce instead of passing this to each call to this function. It is used in the even...
...= $smarty- createTemplate('index.tpl'); // assign variable to template scope $tp...
...the same template, such as pages for displaying different products. See also the...
... object Description Smarty_Internal_Template createTemplate ( string tem...
... createTemplate() createTemplate() createtemplate, createTemplate() Prev  Ch...
-
caching
...ignments here. $contents = get_database_contents(); $smarty- assign($contents); ...
...Cacheability of Plugins Custom Cache Implementation Caching is used to speed up ...
...URRENT); $smarty- display('index.tpl'); ? With caching enabled, the function cal...
...splaying the front page of your website that does not change its content very of...
... Chapter 15. Caching Chapter 15. Caching chapter, 15, caching Chapte...
... Chapter 15. Caching Chapter 15. Caching chapter, 15, caching Chapte...
-
language.builtin.functions
...ration @first @last @show @total {break} {continue} {function} {if},{elseif},{el...
...} {foreach},{foreachelse} @index @iteration @first @last @show @total {break} {c...
...ormance. You cannot create your own custom functions with the same name; and you...
... Chapter 7. Built-in Functions Chapter 7. Built-in Functions chapter...
... Chapter 7. Built-in Functions Chapter 7. Built-in Functions chapter...
...tion. {$var=...} This is a short-hand version of the {assign} function. You can ...
-
language.function.foreach
...ibutes. This syntax is new to Smarty 3, however the Smarty 2.x syntax {foreach f...
... {foreach} properties are @index , @iteration , @first , @last , @show , @total ...
... Chapter 7. Built-in Functions  Next {foreach},{foreachelse} {forea...
... {foreach},{foreachelse} {foreach},{foreachelse} , ldelim, foreach, rdelim, ldel...
-
caching.custom
...l Resource failed: ' . $e- getMessage()); } $this- fetch = $this- db- prepare('S...
... Custom Cache Implementation Custom Cache Implementation custom, cache, implemen...
...L, * PRIMARY KEY (`id`), * INDEX(`name`), * INDEX(`cache_id`), * INDEX(`compile_...
...ead, write, clear calls to your implementation. This API allows you to store whe...
... Chapter 15. Caching  Next Custom Cache Implementation As an alter...
... Custom Cache Implementation Custom Cache Implementation custom, cache, implemen...
-
troubleshooting
... will see an error similar to the following: Example 20.1. Smarty errors W...
...rrors Warning: Smarty: [in index.tpl line 4]: syntax error: unknown tag - '%blah...
...source.php This means that your application registered a custom error hander (us...
...pter 20. Troubleshooting Chapter 20. Troubleshooting chapter, 20, tr...
... Chapter 20. Troubleshooting Chapter 20. Troubleshooting chapter, 20...
-
plugins.resources
...ss via $_template- smarty- getTemplateVars() . These Resources simply echo their...
...s or PHP script components to Smarty. Some examples of resources: databases, LDA...
...pt $smarty- display("mysql:index.tpl"); ? And from within Smarty template: {incl...
...ource.foobarxyz.php within your $plugins_dir , or registered on runtime with reg...
... Chapter 18. Extending Smarty With Plugins  Next Resources Resource ...
...rces Resources Prev  Chapter 18. Extending Smarty With Plugins  Ne...
-
caching.cacheable
...e final output of the page gets cached. However Smarty3 offers several options h...
...offers several options how to exclude sections of your output from caching. Gene...
...); if (!$smarty- isCached('index.tpl')) { // fetch $obj from db and assign... $s...
...how to exclude sections of your output from caching. General Note Be sure any va...
... Controlling Cacheability of Output Controlling Cacheability of Output controlli...
... Controlling Cacheability of Output Controlling Cacheability of Output controlli...
-
language.function.assign
...bles from a php script use getTemplateVars() . Here's the template that creates ...
...lacing application logic into the presentation that may be better handled in PHP...
...ole_page = $smarty- fetch('index.tpl'); // this will output 'smarty' as the temp...
...ter handled in PHP. Use at your own discretion. Note See also the short-form met...
... Chapter 7. Built-in Functions  Next {assign} {assign} is used for ...
... {assign} {assign} , ldelim, assign, rdelim, {assign} Prev  Chapter 7.Â...
...cretion. Note See also the short-form method of assigning template vars. Attribu...
-
resources.custom
...l Resource failed: ' . $e- getMessage()); } $this- fetch = $this- db- prepare('S...
... Custom Template Resources Custom Template Resources custom, template, resources...
...pt $smarty- display("mysql:index.tpl"); ? And from within Smarty template: {incl...
...u can retrieve templates using whatever possible source you can access with PHP:...
... Custom Template Resources Custom Template Resources custom, template, resources...
-
plugins.compiler.functions
...plate as: {* this function gets executed at compile time only *} {tplheader} The...
...sensitive static content into the template. If there is both a compiler function...
...hing like this: ?php echo 'index.tpl compiled at 2002-02-20 20:02'; ? See also r...
... Chapter 18. Extending Smarty With Plugins  Next Compiler Functions ...
...iler Functions Prev  Chapter 18. Extending Smarty With Plugins  Ne...
-
advanced.features.objects
... same way custom functions get them. An associative array is passed as the first...
...jects Smarty allows access to PHP objects through the templates. Note When you a...
...$myobj); $smarty- display('index.tpl'); ? And here's how to access your objects ...
...oose will be determined by your needs, but use the first method whenever possibl...
...s only. It is very easy to inject application logic through objects, and this le...
...bjects Objects Prev  Chapter 17. Advanced Features  Next Objects S...
-
language.function.include.php
... assign('navigation', $db- getRows()); ? where the template is: {* absolute path...
...ty, use registered plugins to properly insulate presentation from the applicatio...
...to include a php script in your template. The path of the attribute file can be ...
... {include_php} {include_php} , ldelim, include_php, rdelim, {include_php} Prev ...
... {include_php} Prev  Chapter 7. Built-in Functions  Next {include_...
.../path/to/load_nav.php'} {* short-hand *} {foreach item='nav' from=$navigation} a...
-
language.function.section
...y- assign('contacts', $db- getAll($sql)); ? The template to output the database ...
...ke {foreach} which is used to loop over a single associative array . Every {sect...
... looping over sequentially indexed arrays of data , unlike {foreach} which is us...
... Chapter 7. Built-in Functions  Next {section},{sectionelse} A {sec...
...,{sectionelse} Prev  Chapter 7. Built-in Functions  Next {section}...
...ction customer $custid} {* short-hand *} id: {$custid[customer]} br / {/section}...
-
language.function.html.select.time
...v  Chapter 8. Custom Functions  Next {html_select_time} {html_sele...
...splay any or all of hour, minute, second and meridian. The time attribute can ha...
...l_select_time} Prev  Chapter 8. Custom Functions  Next {html_selec...
-
variable.cache.lifetime
...SAVED) for $cache_lifetime to have any purpose. A $cache_lifetime value of -1 wi...
...This is the length of time in seconds that a template cache is valid. Once this ...
... $cache_lifetime $cache_lifetime , cache_lifetime $cache_lifetime Prev  Chap...
-
api.get.tags
... getTags() getTags() gettags, getTags() Prev  Chapter 14. Smarty Class...
...= $smarty- createTemplate('index.tpl'); // get tags $tags = $smarty- getTags($tp...
...by template Description string getTags ( object template ); This functio...
... getTags() getTags() gettags, getTags() Prev  Chapter 14. Smarty Class...
-
variable.cache.locking
...ng is disabled by default. To enable it set $cache_locking to TRUE . See also $l...
...s means resource intensive pages can be generated only once, even if they've bee...
... $cache_locking $cache_locking , cache_locking $cache_locking Prev  Chapter...
... $cache_locking $cache_locking , cache_locking $cache_locking Prev  Chapter...
-
variable.default.resource.type
... smarty what resource type to use implicitly. The default value is file , meanin...
...ing that $smarty- display('index.tpl') and $smarty- display('file:index.tpl') ar...
...efault value is file , meaning that $smarty- display('index.tpl') and $smarty- d...
... $default_resource_type $default_resource_type , default_resource_type $default_...
-
api.template.exists
...ists() This example uses $_GET['page'] to {include} a content template. If the t...
...t can accept either a path to the template on the filesystem or a resource strin...
...php // set the filename eg index.inc.tpl $mid_template = $_GET['page'].'.inc.tpl...
...ol templateExists ( string template ); It can accept either a path to th...
... templateExists() templateExists() templateexists, templateExists() Prev  Ch...
-
smarty.for.designers
...ng_format strip strip_tags to_charset truncate unescape upper wordwrap 6. Combin...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
...Functions Attributes Embedding Vars in Double Quotes Math Escaping Smarty Parsin...
... Part II. Smarty For Template Designers Part II. Smarty For Template...
-
api.assign.by.ref
... , append() , {assign} and getTemplateVars() . Prev  Up  Next assign()Â...
...ed var ); This is used to assign() values to the templates by reference. Tec...
...ul if you want a PHP array index value to be affected by its reassignment from a...
... void assignByRef ( string varname ,         Â...
... assignByRef() assignByRef() assignbyref, assignByRef() Prev  Chapter 14....
-
language.function.html.select.date
...v  Chapter 8. Custom Functions  Next {html_select_date} {html_sele...
...ll parameters that are not in the list below are printed as name/value-pairs ins...
... {html_select_date} {html_select_date} , ldelim, html_select_date, rdelim, {html...
-
language.variable.scopes
...scopes You have the choice to assign variables to the scope of the main Smarty o...
...= $smarty- createTemplate('index.tpl'); $tpl- assign('bar','bar-template'); // a...
...bles to the scope of the main Smarty object, data objects created with createDat...
... Variable scopes Variable scopes variable, scopes Variable scopes Prev  Chap...
-
variable.escape.html
...ke sure that the templates get recompiled. Prev  Up  Next $error_reporti...
..._html Setting $escape_html to TRUE will escape all template variable output by w...
... Next $escape_html Setting $escape_html to TRUE will escape all template var...
... $escape_html $escape_html , escape_html $escape_html Prev  Chapter 13.Â...
-
api.append.by.ref
...so append() , assign() and getTemplateVars() . Prev  Up  Next append()Â...
... merge ); This is used to append() values to the templates by reference. Tec...
...ul if you want a PHP array index value to be affected by its reassignment from a...
... void appendByRef ( string varname ,         Â...
... appendByRef() appendByRef() appendbyref, appendByRef() Prev  Chapter 14....
-
variable.compile.id
...s $compile_id and you will get a set of compiled templates for each language you...
...ntifier. As an alternative to passing the same $compile_id to each and every fun...
...a prefilter that localizes your templates (that is: translates language dependen...
.... As an alternative to passing the same $compile_id to each and every function c...
...id $compile_id Prev  Chapter 13. Smarty Class Variables  Next $com...
-
language.syntax.quotes
... find your template syntax getting too complex, it may be a good idea to move th...
...This is useful if you want to include variables with modifiers, plugin or PHP fu...
... presentation. If you find your template syntax getting too complex, it may be a...
... Embedding Vars in Double Quotes Embedding Vars in Double Quotes embedding, vars...
... Embedding Vars in Double Quotes Embedding Vars in Double Quotes embedding, vars...
-
advanced.features.template.inheritance
...bject Oriented Programming to templates, allowing you to define one (or more) ba...
...ne the inheritance tree in your PHP script by using the extends: resource type. ...
... Template Inheritance Template Inheritance template, inheritance Template Inheri...
... Template Inheritance Template Inheritance template, inheritance Template Inheri...
-
language.function.config.load
...mment # global variables pageTitle = "Main Menu" bodyBgColor = #000000 tableBgCo...
...rom a configuration file into the template. Attributes: Attribute Name Type Requ...
... Chapter 7. Built-in Functions  Next {config_load} {config_load} is...
... {config_load} {config_load} , ldelim, config_load, rdelim, {config_load} Prev ...
...ig_load "example.conf"} {* short-hand *} html title {#pageTitle#|default:"No tit...
-
api.is.cached
...n . Prev  Up  Next getTemplateVars() Home  loadFilter() ...
...y works if $caching is set to one of Smarty::CACHING_LIFETIME_CURRENT or Smarty:...
...T); if(!$smarty- isCached('index.tpl')) { // do database calls, assign vars here...
...ion bool isCached ( string template ,         Â...
... isCached() isCached() iscached, isCached() Prev  Chapter 14. Smarty C...
-
advanced.features
... checked when the template gets compiled. For that reasion you should delete all...
...s eg via ftp, and you want to reduce the risk of system security compromises thr...
...late files when you change your security settings. Prev  Up  Next Custom...
... of Contents Security Changing settings by template Template Inheritance Streams...
... Chapter 17. Advanced Features Chapter 17. Advanced Features chapter...
-
language.function.html.table
...v  Chapter 8. Custom Functions  Next {html_table} {html_table} is ...
...dd"') ); $smarty- display('index.tpl'); ? The variables assigned from php could ...
...hat dumps an array of data into an HTML table . Attribute Name Type Required Def...
... {html_table} {html_table} , ldelim, html_table, rdelim, {html_table} Prev  ...
-
resources.string
...ompiled from a string and stores the compiled template code for later reuse. Eac...
...compiled template file. If your template strings are accessed frequently, this i...
... String Template Resources String Template Resources string, template, resources...
... String Template Resources String Template Resources string, template, resources...
-
advanced.features.template.settings
...tions . Modifications done to the Smarty object will be global for all templates...
...= $smarty- createTemplate('index.tpl); $tpl- cache_lifetime = 600; //or $tpl- se...
... Changing settings by template Changing settings by template changing, settings,...
... Changing settings by template Changing settings by template changing, settings,...
-
plugins.prefilters.postfilters
...n ?php print_r(\$template- getTemplateVars()); ? \n /pre " . $compiled; return $...
...; Â Prefilters are used to process the source of the template immediately bef...
... Chapter 18. Extending Smarty With Plugins  Next Prefilters/Postfilt...
...rs/Postfilters Prev  Chapter 18. Extending Smarty With Plugins  Ne...
-
tips
...ing Passing variable title to header template Dates WAP/WML Componentized Templa...
...ntents Blank Variable Handling Default Variable Handling Passing variable title ...
... Chapter 21. Tips Tricks Chapter 21. Tips Tricks chapter, 21, tips, ...
...andle this, but there is a shorthand way with Smarty, using the default variable...
-
language.function.extends
...tax for template resources to extend files outside of the $template_dir director...
... Chapter 7. Built-in Functions  Next {extends} {extends} tags are u...
...lim, {extends} Prev  Chapter 7. Built-in Functions  Next {extends}...
... {extends 'parent.tpl'} {* short-hand *} See also Template Interitance and {bloc...
-
plugins.block.functions
...ns take precedence over custom functions of the same name, that is, you cannot h...
...unc}..{/func} . By default your function implementation is called twice by Smart...
... Chapter 18. Extending Smarty With Plugins  Next Block Functions voi...
...lock Functions Prev  Chapter 18. Extending Smarty With Plugins  Ne...
-
preface
...tegration Sometimes Smarty gets compared to Model-View-Controller (MVC) framewor...
...d designers quick and easy to maintain syntax easy to understand, no PHP knowled...
...esentation. Smarty focuses your templates on presentation and less on "code". Th...
...in our templates as single pages. We can then manipulate blocks of content withi...
...igners quick and easy to maintain syntax easy to understand, no PHP knowledge ne...
... Preface Preface preface Preface Prev    Next Preface The Philosophy...
-
tips.default.var.handling
...y time it is mentioned can get a bit ugly. You can remedy this by assigning the ...
...* do this somewhere at the top of your template *} {assign var='title' value=$ti...
...used frequently throughout your templates, applying the default modifier every t...
... Default Variable Handling Default Variable Handling default, variable, handling...
... Default Variable Handling Default Variable Handling default, variable, handling...
-
variable.locking.timeout
...onds a cache lock is valid to avoid dead locks. The deafult value is 10 seconds....
... $locking_timeout $locking_timeout , locking_timeout $locking_timeout Prev  ...
...ocking_timeout Prev  Chapter 13. Smarty Class Variables  Next $loc...
-
variable.caching
...ells Smarty whether or not to cache the output of the templates to the $cache_di...
...nt Smarty::CACHING_OFF. If your templates consistently generate the same content...
... $caching $caching , caching $caching Prev  Chapter 13. Smarty Class V...
... $caching $caching , caching $caching Prev  Chapter 13. Smarty Class V...
-
advanced.features.outputfilters
...ates before they are saved to the disk, whereas output filters operate on the te...
...email"); $smarty- display("index.tpl'); // now any occurrence of an email addres...
...filter ?php // put this in your application function protect_email($tpl_output, ...
...lters When the template is invoked via display() or fetch() , its output can be ...
...Output Filters Prev  Chapter 17. Advanced Features  Next Output Fi...
-
plugins.inserts
...ts Insert plugins are used to implement functions that are invoked by {insert} t...
... Inserts Inserts inserts Inserts Prev  Chapter 18. Extending Smarty Wi...
...nserts Inserts Prev  Chapter 18. Extending Smarty With Plugins  Ne...
-
language.function.block
...xt {block} {block} is used to define a named area of template source for templat...
... Chapter 7. Built-in Functions  Next {block} {block} is used to def...
...delim, {block} Prev  Chapter 7. Built-in Functions  Next {block} {...
...lt Title{/block} /title {* short-hand *} /head /html child.tpl {extends file="pa...
-
language.modifier.strip
...d string. Note If you want to strip blocks of template text, use the built-in {s...
... one."); $smarty- display('index.tpl'); ? Where template is: {$articleTitle} {$a...
...s all repeated spaces, newlines and tabs with a single space, or with the suppli...
...ip strip strip Prev  Chapter 5. Variable Modifiers  Next strip Thi...
-
caching.groups
...f cache groups like a directory hierarchy. For instance, a cache group of 'a|b|c...
...structure like themes/blue/index.tpl and you want to be able to clear all the ca...
...LY. You will need to group your templates under a single cache group heirarchy t...
... Chapter 15. Caching  Next Cache Groups You can do more elaborate ...
... Cache Groups Cache Groups cache, groups Cache Groups Prev  Chapter 15.Â...
-
language.variables
...ditional expressions, etc. To print a variable, simply enclose it in the delimit...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
... Chapter 4. Variables Chapter 4. Variables chapter, 4, variables Cha...
-
advanced.features.postfilters
...aded from the plugins directory by using the loadFilter() function or by setting...
...mment'); $smarty- display('index.tpl'); ? The postfilter above will make the com...
...ers are PHP functions that your templates are ran through after they are compile...
...red or loaded from the plugins directory by using the loadFilter() function or b...
...rs Postfilters Prev  Chapter 17. Advanced Features  Next Postfilte...
-
tips.obfuscating.email
...der how your email address gets on so many spam mailing lists? One way spammers ...
...dresses is from web pages. To help combat this problem, you can make your email ...
...ses Do you ever wonder how your email address gets on so many spam mailing lists...
...mail addresses is from web pages. To help combat this problem, you can make your...
... Obfuscating E-mail Addresses Obfuscating E-mail Addresses obfuscating, e, mail,...
... Obfuscating E-mail Addresses Obfuscating E-mail Addresses obfuscating, e, mail,...
-
api.fetch
...t that would automatically get wrapped at 40 characters. This helps make the tex...
...in the event that you want to compile different versions of the same template, s...
... $output = $smarty- fetch('index.tpl', $cache_id); // do something with $output ...
...e link below to login with your user name of '{$contact_info.username}' so you c...
...late output Description string fetch ( string template ,    Â...
...fetch, fetch() Prev  Chapter 14. Smarty Class Methods  Next Name f...
-
api.display
...he contents of a template. To return the contents of a template into a variable,...
...ist if(!$smarty- isCached('index.tpl')) { // dummy up some data $address = '245 ...
...tion void display ( string template ,         Â...
... display() display() display, display() Prev  Chapter 14. Smarty Class...
-
caching.multiple.caches
...CURRENT); $my_cache_id = $_GET['article_id']; $smarty- display('index.tpl', $my_...
...he files for a single call to display() or fetch() . Let's say that a call to di...
...ay that a call to display('index.tpl') may have several different output content...
... can “ group †your caches together by giving them the same $cache_i...
... Chapter 15. Caching  Next Multiple Caches Per Page You can have m...
... Multiple Caches Per Page Multiple Caches Per Page multiple, caches, per, page M...
-
installing.smarty.extended
...or. // These automatically get set with each new instance. parent::__construct()...
...slightly more flexible way to setup Smarty is to extend the class and initialize...
...; } } ? Now lets alter the index.php file to use setup.php : Example 2.11.Â...
...d the class and initialize your Smarty environment. So instead of repeatedly set...
...Prev  Chapter 2. Installation  Next Extended Setup This is a conti...
...Extended Setup Prev  Chapter 2. Installation  Next Extended Setup ...
-
variable.force.compile
...compile This forces Smarty to (re)compile templates on every invocation. This se...
...compile templates on every invocation. This setting overrides $compile_check . B...
...$force_compile Prev  Chapter 13. Smarty Class Variables  Next $for...
-
tips.componentized.templates
...y, programming templates into your applications goes as follows: First, you accu...
...sign'], $ticker_info); } ? index.tpl {load_ticker symbol='SMARTY' assign='ticker...
...programming templates into your applications goes as follows: First, you accumul...
...tes Traditionally, programming templates into your applications goes as follows:...
... Componentized Templates Componentized Templates componentized, templates Compon...
-
api.register.resource
...source_handler ); Use this to dynamically register a Resource plugin with Smarty...
...marty- display('c:/path/to/index.tpl'); Note Prior to Smarty 3.1 registerResourc...
... registerResource ( string name ,          Â...
...sterResource() Prev  Chapter 14. Smarty Class Methods  Next Name r...
-
index
...ble of Contents Preface I. Getting Started 1. What is Smarty? 2. Installation Re...
...m Uwe Tews uwe dot tews at googlemail dot com Copyright © 2001-2011 New Digit...
...ng_format strip strip_tags to_charset truncate unescape upper wordwrap 6. Combin...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
... Next Smarty - the compiling PHP template engine Monte Ohrt monte at ohrt dot ...
... Smarty 3 Manual Smarty 3 Manual smarty, 3, manual Smarty 3 Manual   Â...
-
variable.default.config.handler.func
...s file: resource is unable to load a requested file * * @param string $type reso...
... config file cannot be obtained from its resource. Note The default handler is c...
... $default_config_handler_func $default_config_handler_func , default_config_hand...
-
api.clear.compiled.tpl
... clear entire compile directory $smarty- clearCompiledTemplate(); ? See also cle...
...ty- clearCompiledTemplate('index.tpl'); // clear entire compile directory $smart...
...clearCompiledTemplate ( string tpl_file ,         Â...
... clearCompiledTemplate() clearCompiledTemplate() clearcompiledtemplate, clearCom...
-
plugins.functions
... All attributes passed to template functions from the template are contained...
...Ask again soon', 'Maybe in your reality'); $result = array_rand($answers); retur...
... Chapter 18. Extending Smarty With Plugins  Next Template Functions ...
... Template Functions Template Functions template, functions Template Functions Pr...
-
variable.default.template.handler.func
...s file: resource is unable to load a requested file * * @param string $type reso...
...n a template cannot be obtained from its resource. Note The default handler is c...
... $default_template_handler_func $default_template_handler_func , default_templat...
-
language.modifier.date.format
...mplate uses $smarty.now to get the current time: {$smarty.now|date_format} {$sma...
... formats a date and time into the given strftime() format. Dates can be passed t...
...ers available depending on your system's strftime() function where PHP was compi...
...is formats a date and time into the given strftime() format. Dates can be passed...
... date_format date_format date_format date_format Prev  Chapter 5. Vari...
-
resources
...id namespace conflicts and get the desired results. Example 16.4. Using te...
...ir Templates from any directory Windows Filepaths String Template Resources Stre...
...dir ?php $smarty- display('index.tpl'); $smarty- display('file:index.tpl'); // s...
...plates from any directory Windows Filepaths String Template Resources Stream Tem...
... Chapter 16. Resources Chapter 16. Resources chapter, 16, resources ...
-
variable.compile.check
...ince the template will not get recompiled. If $caching is enabled and $compile_c...
... application, Smarty tests to see if the current template has changed (different...
...t $compile_check Upon each invocation of the PHP application, Smarty tests to se...
...$compile_check Prev  Chapter 13. Smarty Class Variables  Next $com...
-
language.function.call
...Next {call} {call} is used to call a template function defined by the {function}...
... Chapter 7. Built-in Functions  Next {call} {call} is used to call ...
... {call} {call} , ldelim, call, rdelim, {call} Prev  Chapter 7. Built-i...
... {call menu data=$menu} {* short-hand *} Will generate the following output * it...
-
language.function.function
...nction} {function} is used to create functions within a template and call them j...
... Chapter 7. Built-in Functions  Next {function} {function} is used ...
...im, {function} Prev  Chapter 7. Built-in Functions  Next {function...
...{function menu level=0} {* short-hand *} ul class="level{$level}" {foreach $data...
-
language.function.capture
...ort-hand *} {include file="get_banner.tpl"} {/capture} {if $smarty.capture.banne...
...capture} {capture} is used to collect the output of the template between the tag...
...r} at {$my_server_addr} br Your ip is {$my_ip}. {/capture} a href="#" {$popText}...
... Chapter 7. Built-in Functions  Next {capture} {capture} is used to...
... {capture} {capture} , ldelim, capture, rdelim, {capture} Prev  Chapter 7...
...er"} {capture "banner"} {* short-hand *} {include file="get_banner.tpl"} {/captu...
-
api.create.data
...parameter. It is an uplink to the main Smarty object, a another user-created dat...
...= $smarty- createTemplate('index.tpl',$data); // display the template $tpl- disp...
...data object Description string createData ( object parent ); string ...
... createData() createData() createdata, createData() Prev  Chapter 14. ...
-
variable.direct.access.security
...ke sure that the templates get recompiled. Prev  Up  Next $default_templ...
...bits direct browser access to compiled or cached template files. Direct access s...
...ity Direct access security inhibits direct browser access to compiled or cached ...
... $direct_access_security $direct_access_security , direct_access_security $direc...
-
variable.merge.compiled.includes
...ke sure that the templates get recompiled. See also {include} tag Prev  Up ...
...g $merge_compiled_includes to TRUE Smarty will merge the compiled template code ...
... $merge_compiled_includes $merge_compiled_includes , merge_compiled_includes $me...
...piled_includes Prev  Chapter 13. Smarty Class Variables  Next $mer...
-
api.register.plugin
... $object being a reference to an object and $method being a string containing th...
...ions or methods defined in your script as plugin. It uses the following paramete...
... registerPlugin() registerPlugin() registerplugin, registerPlugin() Prev  Ch...
...gisterPlugin() Prev  Chapter 14. Smarty Class Methods  Next Name r...
-
api.clear.cache
... You can group templates together so they can be removed as a group, see the cac...
...r. You can group templates together so they can be removed as a group, see the c...
...plate $smarty- clearCache('index.tpl'); // clear the cache for a particular cach...
...n void clearCache ( string template ,         Â...
... clearCache() clearCache() clearcache, clearCache() Prev  Chapter 14. ...
-
language.modifier.default
... Next default This is used to set a default value for a variable. If the variabl...
...he blank variable handling pages. Prev  Up  Next date_format Home Â...
...le is unset or an empty string, the given default value is printed instead. Defa...
... default default default default Prev  Chapter 5. Variable Modifiers ...
-
advanced.features.prefilters
...eprocessing your templates to remove unwanted comments, keeping an eye on what p...
...ments'); $smarty- display('index.tpl'); ? See also registerFilter() , postfilter...
...ers are PHP functions that your templates are ran through before they are compil...
...This is good for preprocessing your templates to remove unwanted comments, keepi...
...ers Prefilters Prev  Chapter 17. Advanced Features  Next Prefilter...