-
installing.smarty.basic
... get changed when you upgrade to a new version of Smarty. In the examples below ...
...com/ guestbook/ templates/ index.tpl templates_c/ configs/ cache/ htdocs/ index....
-
api.get.tags
...turn tags used by template Description string getTags ( object template ...
...= $smarty- createTemplate('index.tpl'); // get tags $tags = $smarty- getTags($tp...
-
language.function.append
... {append} {append} , ldelim, append, rdelim, {append} Prev  Chapter 7.Â...
...a The value being assigned index string No n/a The index for the new array eleme...
-
variable.default.resource.type
... $default_resource_type $default_resource_type , default_resource_type $default_...
...ing that $smarty- display('index.tpl') and $smarty- display('file:index.tpl') ar...
-
language.variables.smarty
...arty} reserved variable , ldelim, smarty, rdelim, reserved, variable {$smarty} r...
...ET) http://www.example.com/index.php?page=foo *} {$smarty.get.page} {* display t...
-
api.template.exists
... specified template exists Description bool templateExists ( string temp...
...php // set the filename eg index.inc.tpl $mid_template = $_GET['page'].'.inc.tpl...
-
smarty.for.designers
...II. Smarty For Template Designers Part II. Smarty For Template Designer...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
-
language.syntax.variables
...ain numbers, letters and underscores, much like a PHP variable . You can referen...
...ou can reference arrays by index numerically or non-numerically. Also reference ...
-
api.assign.by.ref
...assign values by reference Description void assignByRef ( string varname...
...ul if you want a PHP array index value to be affected by its reassignment from a...
-
language.variable.scopes
...hain of parent objects. By default templates which are rendered by $smarty- disp...
...= $smarty- createTemplate('index.tpl'); $tpl- assign('bar','bar-template'); // a...
-
api.create.template
... returns a template object Description Smarty_Internal_Template createTempla...
...= $smarty- createTemplate('index.tpl'); // assign variable to template scope $tp...
-
api.append.by.ref
...append values by reference Description void appendByRef ( string varname...
...ul if you want a PHP array index value to be affected by its reassignment from a...
-
caching
...ile could conceivably be made up of several template files, config files, etc. S...
...URRENT); $smarty- display('index.tpl'); ? With caching enabled, the function cal...
-
api.is.cached
...id cache for this template Description bool isCached ( string template ,...
...T); if(!$smarty- isCached('index.tpl')) { // do database calls, assign vars here...
-
language.builtin.functions
...II. Smarty For Template Designers  Next Chapter 7. Built-in Functio...
...} {foreach},{foreachelse} @index @iteration @first @last @show @total {break} {c...
-
language.function.html.table
...tml_table} {html_table} , ldelim, html_table, rdelim, {html_table} Prev  Cha...
...dd"') ); $smarty- display('index.tpl'); ? The variables assigned from php could ...
-
advanced.features.template.settings
...v  Chapter 17. Advanced Features  Next Changing settings by templa...
...that template and its included subtemplates. Example 17.4. changing Smarty...
...= $smarty- createTemplate('index.tpl); $tpl- cache_lifetime = 600; //or $tpl- se...
...v  Chapter 17. Advanced Features  Next Changing settings by templa...
-
language.function.foreach
...d and name . What is the advantage of an iterator vs. looping over a plain old a...
...{foreach},{foreachelse} , ldelim, foreach, rdelim, ldelim, foreachelse, rdelim, ...
... {foreach} properties are @index , @iteration , @first , @last , @show , @total ...
...d and name . What is the advantage of an iterator vs. looping over a plain old a...
-
caching.custom
...n alternative to using the default file-based caching mechanism, you can specify...
...L, * PRIMARY KEY (`id`), * INDEX(`name`), * INDEX(`cache_id`), * INDEX(`compile_...
-
troubleshooting
...ors Warning: Smarty: [in index.tpl line 4]: syntax error: unknown tag - '%blah' ...
...rrors Warning: Smarty: [in index.tpl line 4]: syntax error: unknown tag - '%blah...
-
advanced.features.outputfilters
...v  Chapter 17. Advanced Features  Next Output Filters When the tem...
...be either registered or loaded from the plugins directory by using the loadFilte...
...email"); $smarty- display("index.tpl'); // now any occurrence of an email addres...
...v  Chapter 17. Advanced Features  Next Output Filters When the tem...
-
plugins.resources
... implement the function renderUncompiled(Smarty_Internal_Template $_template) . ...
...pt $smarty- display("mysql:index.tpl"); ? And from within Smarty template: {incl...
-
language.modifier.strip
...ne."); $smarty- display('index.tpl'); ? Where template is: {$articleTitle} {$art...
... one."); $smarty- display('index.tpl'); ? Where template is: {$articleTitle} {$a...
-
caching.cacheable
...everal options how to exclude sections of your output from caching. General Note...
...); if (!$smarty- isCached('index.tpl')) { // fetch $obj from db and assign... $s...
-
caching.groups
...) it is treated as an appended cache group '/a/b/c/foo/' . If you specify a temp...
...structure like themes/blue/index.tpl and you want to be able to clear all the ca...
-
language.variables
...arty- assign('lastname', 'Evans'); $smarty- assign('meetingPlace', 'New York'); ...
...II. Smarty For Template Designers  Next Chapter 4. Variables Table ...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
...arty- assign('lastname', 'Evans'); $smarty- assign('meetingPlace', 'New York'); ...
-
advanced.features.postfilters
...v  Chapter 17. Advanced Features  Next Postfilters Template postfi...
...be either registered or loaded from the plugins directory by using the loadFilte...
...mment'); $smarty- display('index.tpl'); ? The postfilter above will make the com...
...v  Chapter 17. Advanced Features  Next Postfilters Template postfi...
-
api.fetch
...eturns the template output Description string fetch ( string template , ...
... $output = $smarty- fetch('index.tpl', $cache_id); // do something with $output ...
-
api.display
...” displays the template Description void display ( string template , ...
...ist if(!$smarty- isCached('index.tpl')) { // dummy up some data $address = '245 ...
-
language.function.assign
... {assign} {assign} , ldelim, assign, rdelim, {assign} Prev  Chapter 7.Â...
...ole_page = $smarty- fetch('index.tpl'); // this will output 'smarty' as the temp...
-
caching.multiple.caches
... that a call to display('index.tpl') may have several different output contents ...
...ay that a call to display('index.tpl') may have several different output content...
-
resources.custom
...me  Chapter 17. Advanced Features ...
...s you are supposed to provide. Note Note that you cannot override the built-in f...
...pt $smarty- display("mysql:index.tpl"); ? And from within Smarty template: {incl...
...me  Chapter 17. Advanced Features ...
-
plugins.compiler.functions
...useful for injecting PHP code or time-sensitive static content into the template...
...hing like this: ?php echo 'index.tpl compiled at 2002-02-20 20:02'; ? See also r...
-
installing.smarty.extended
... Extended Setup Extended Setup extended, setup Extended Setup Prev  Chapter...
...; } } ? Now lets alter the index.php file to use setup.php : Example 2.11.Â...
-
tips.componentized.templates
...gn'], $ticker_info); } ? index.tpl {load_ticker symbol='SMARTY' assign='ticker'}...
...sign'], $ticker_info); } ? index.tpl {load_ticker symbol='SMARTY' assign='ticker...
-
api.register.resource
...mically register resources Description void registerResource ( string na...
...marty- display('c:/path/to/index.tpl'); Note Prior to Smarty 3.1 registerResourc...
-
index
...m Template Resources 17. Advanced Features Security Changing settings by templat...
...ts Basic Installation Extended Setup II. Smarty For Template Designers 3. Basic ...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
...m Template Resources 17. Advanced Features Security Changing settings by templat...
-
advanced.features.objects
...v  Chapter 17. Advanced Features  Next Objects Smarty allows acces...
...ts, and this leads to poor designs that are difficult to manage. See the Best Pr...
...$myobj); $smarty- display('index.tpl'); ? And here's how to access your objects ...
...v  Chapter 17. Advanced Features  Next Objects Smarty allows acces...
-
api.clear.compiled.tpl
...ge. This function is for advanced use only, not normally needed. Example 14.1...
...pecified template resource Description void clearCompiledTemplate ( stringÂ...
...ty- clearCompiledTemplate('index.tpl'); // clear entire compile directory $smart...
...ge. This function is for advanced use only, not normally needed. Example 14.1...
-
language.function.section
...{section},{sectionelse} , ldelim, section, rdelim, ldelim, sectionelse, rdelim, ...
... looping over sequentially indexed arrays of data , unlike {foreach} which is us...
-
resources
...template, or when you include a template from within another template, you suppl...
...dir ?php $smarty- display('index.tpl'); $smarty- display('file:index.tpl'); // s...
-
api.create.data
...” creates a data object Description string createData ( object parent...
...= $smarty- createTemplate('index.tpl',$data); // display the template $tpl- disp...
-
api.clear.cache
...he for a specific template Description void clearCache ( string template...
...plate $smarty- clearCache('index.tpl'); // clear the cache for a particular cach...
-
advanced.features.prefilters
...v  Chapter 17. Advanced Features  Next Prefilters Template prefilt...
...be either registered or loaded from the plugins directory by using loadFilter() ...
...ments'); $smarty- display('index.tpl'); ? See also registerFilter() , postfilter...
...v  Chapter 17. Advanced Features  Next Prefilters Template prefilt...