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