-
preface
...d designers quick and easy to maintain syntax easy to understand, no PHP knowled...
...eatures that can further enforce restrictions on templates. Web designers and PH...
...d designers quick and easy to maintain syntax easy to understand, no PHP knowled...
...ices section of the Smarty website. How does it work? Under the hood, Smarty "co...
-
advanced.features.objects
...jects Smarty allows access to PHP objects through the templates. Note When you a...
...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 ...
...ices section of the Smarty website. There are two ways to access them. One way i...
-
api.create.template
...ce instead of passing this to each call to this function. It is used in the even...
...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...
-
caching
...Cacheability of Plugins Custom Cache Implementation Caching is used to speed up ...
...isplay('index.tpl'); ? If $force_compile is enabled, the cache files will always...
...Cacheability of Plugins Custom Cache Implementation Caching is used to speed up ...
...URRENT); $smarty- display('index.tpl'); ? With caching enabled, the function cal...
...ing the front page of your website that does not change its content very often, ...
-
caching.cacheable
...offers several options how to exclude sections of your output from caching. Gene...
...d cached template files to force a recompile. Example 15.12. Nocache Varia...
...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...
-
installing.smarty.basic
...are in the /libs/ sub directory of the distribution. These are .php files that y...
...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....
-
variable.cache.lifetime
...SAVED) for $cache_lifetime to have any purpose. A $cache_lifetime value of -1 wi...
..._lifetime value of -1 will force the cache to never expire. A value of 0 will ca...
...SAVED) for $cache_lifetime to have any purpose. A $cache_lifetime value of -1 wi...
-
api.get.tags
...= $smarty- createTemplate('index.tpl'); // get tags $tags = $smarty- getTags($tp...
-
variable.cache.locking
...ng is disabled by default. To enable it set $cache_locking to TRUE . See also $l...
...ng is disabled by default. To enable it set $cache_locking to TRUE . See also $l...
-
language.function.append
...lacing application logic into the presentation that may be better handled in PHP...
...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...
-
variable.default.resource.type
... smarty what resource type to use implicitly. The default value is file , meanin...
... 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...
-
language.variables.smarty
...arty} variable can be used to access several environment and request variables. ...
...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...
-
api.template.exists
...t can accept either a path to the template on the filesystem or a resource strin...
...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...
-
smarty.for.designers
...ng_format strip strip_tags to_charset truncate unescape upper wordwrap 6. Combin...
...ng_format strip strip_tags to_charset truncate unescape upper wordwrap 6. Combin...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
-
language.syntax.variables
...variables are an exception to the $dollar syntax and are instead referenced with...
...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 ...
-
api.assign.by.ref
...ed var ); This is used to assign() values to the templates by reference. Tec...
...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...
-
language.variable.scopes
...scopes You have the choice to assign variables to the scope of the main Smarty o...
...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...
-
api.append.by.ref
... merge ); This is used to append() values to the templates by reference. Tec...
... 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...
-
variable.debugging.ctrl
...This allows alternate ways to enable debugging. NONE means no alternate methods ...
...This allows alternate ways to enable debugging. NONE means no alternate methods ...
-
api.is.cached
...y works if $caching is set to one of Smarty::CACHING_LIFETIME_CURRENT or Smarty:...
...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...
-
language.builtin.functions
...ration @first @last @show @total {break} {continue} {function} {if},{elseif},{el...
...ration @first @last @show @total {break} {continue} {function} {if},{elseif},{el...
...} {foreach},{foreachelse} @index @iteration @first @last @show @total {break} {c...
-
language.function.html.table
...v  Chapter 8. Custom Functions  Next {html_table} {html_table} is ...
...v  Chapter 8. Custom Functions  Next {html_table} {html_table} is ...
...dd"') ); $smarty- display('index.tpl'); ? The variables assigned from php could ...
-
advanced.features.template.settings
...tions . Modifications done to the Smarty object will be global for all templates...
...tions . Modifications done to the Smarty object will be global for all templates...
...= $smarty- createTemplate('index.tpl); $tpl- cache_lifetime = 600; //or $tpl- se...
-
bugs
...on of Smarty, or check the website. Prev  Up  Chapter 22. Resource...
-
language.function.foreach
...ibutes. This syntax is new to Smarty 3, however the Smarty 2.x syntax {foreach f...
...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 ...
-
caching.custom
... Custom Cache Implementation Custom Cache Implementation custom, cache, implemen...
... Custom Cache Implementation Custom Cache Implementation custom, cache, implemen...
...L, * PRIMARY KEY (`id`), * INDEX(`name`), * INDEX(`cache_id`), * INDEX(`compile_...
-
troubleshooting
... will see an error similar to the following: Example 20.1. Smarty errors W...
... 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...
-
advanced.features.static.classes
...in PHP. Note Direct access to PHP classes is not recommended. This ties the unde...
...in PHP. Note Direct access to PHP classes is not recommended. This ties the unde...
...ices section of the Smarty website. Example 17.10. static class access syn...
-
advanced.features.outputfilters
...ates before they are saved to the disk, whereas output filters operate on the te...
...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...
-
plugins.resources
...s or PHP script components to Smarty. Some examples of resources: databases, LDA...
...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...
-
language.modifier.strip
...d string. Note If you want to strip blocks of template text, use the built-in {s...
...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...
-
caching.groups
...f cache groups like a directory hierarchy. For instance, a cache group of 'a|b|c...
...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...
-
api.assign
... assign variables/objects to the templates Description void assign ( mixed...
... assign variables/objects to the templates Description void assign ( mixed...
...ices section of the Smarty website. Example 14.6. assign() ?php // passing...
-
language.variables
...ditional expressions, etc. To print a variable, simply enclose it in the delimit...
...ditional expressions, etc. To print a variable, simply enclose it in the delimit...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
-
advanced.features.postfilters
...aded from the plugins directory by using the loadFilter() function or by setting...
...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...
-
tips.obfuscating.email
...dresses is from web pages. To help combat this problem, you can make your email ...
...dresses is from web pages. To help combat this problem, you can make your email ...
-
api.fetch
...in the event that you want to compile different versions of the same template, s...
...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 ...
-
api.compile.all.config
...mit is an optional integer to set a runtime limit in seconds for the compilation...
...    boolean force ,            ...
...mit is an optional integer to set a runtime limit in seconds for the compilation...
-
api.display
...he contents of a template. To return the contents of a template into a variable,...
...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 ...
-
language.function.assign
...lacing application logic into the presentation that may be better handled in PHP...
...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...
-
caching.multiple.caches
...he files for a single call to display() or fetch() . Let's say that a call to di...
...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...
-
resources.custom
... Custom Template Resources Custom Template Resources custom, template, resources...
... Custom Template Resources Custom Template Resources custom, template, resources...
...pt $smarty- display("mysql:index.tpl"); ? And from within Smarty template: {incl...
-
api.register.object
...ou register/assign objects to templates, be sure that all properties and methods...
...ou register/assign objects to templates, be sure that all properties and methods...
...ices section of the Smarty website. See the objects section for more information...
-
plugins.compiler.functions
...sensitive static content into the template. If there is both a compiler function...
...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...
-
installing.smarty.extended
...slightly more flexible way to setup Smarty is to extend the class and initialize...
...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.Â...
-
tips.componentized.templates
...y, programming templates into your applications goes as follows: First, you accu...
...y, programming templates into your applications goes as follows: First, you accu...
...sign'], $ticker_info); } ? index.tpl {load_ticker symbol='SMARTY' assign='ticker...
-
api.register.resource
...source_handler ); Use this to dynamically register a Resource plugin with Smarty...
...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...
-
index
...ng_format strip strip_tags to_charset truncate unescape upper wordwrap 6. Combin...
...or_reporting $escape_html $force_cache $force_compile $left_delimiter $locking_t...
...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...
-
language.function.cycle
...v  Chapter 8. Custom Functions  Next {cycle} {cycle} is used to al...
...} an unique name . You can force the current value not to print with the print a...
...v  Chapter 8. Custom Functions  Next {cycle} {cycle} is used to al...
-
api.compile.all.templates
...mit is an optional integer to set a runtime limit in seconds for the compilation...
...    boolean force ,            ...
...mit is an optional integer to set a runtime limit in seconds for the compilation...
-
api.clear.compiled.tpl
... clear entire compile directory $smarty- clearCompiledTemplate(); ? See also cle...
... clear entire compile directory $smarty- clearCompiledTemplate(); ? See also cle...
...ty- clearCompiledTemplate('index.tpl'); // clear entire compile directory $smart...
-
language.function.section
...ke {foreach} which is used to loop over a single associative array . Every {sect...
...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...
-
resources
...ir Templates from any directory Windows Filepaths String Template Resources Stre...
...ir Templates from any directory Windows Filepaths String Template Resources Stre...
...dir ?php $smarty- display('index.tpl'); $smarty- display('file:index.tpl'); // s...
...template_dir . This allows websites employing multiple sets of templates better ...
-
language.function.insert
...he output will be assigned to script string No n/a The name of the php script th...
...he output will be assigned to script string No n/a The name of the php script th...
-
api.create.data
...parameter. It is an uplink to the main Smarty object, a another user-created dat...
...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...
-
api.clear.cache
...r. You can group templates together so they can be removed as a group, see the c...
...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...
-
language.modifier.default
... Next default This is used to set a default value for a variable. If the variabl...
... Next default This is used to set a default value for a variable. If the variabl...
-
advanced.features.prefilters
...eprocessing your templates to remove unwanted comments, keeping an eye on what p...
...eprocessing your templates to remove unwanted comments, keeping an eye on what p...
...ments'); $smarty- display('index.tpl'); ? See also registerFilter() , postfilter...