-
installing.smarty.basic
...is assumend to be in 'includes/' dir under current script define('SMARTY_DIR',st...
...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
...Name Type Required Default Description var string Yes n/a The name of the variab...
...a The value being assigned index string No n/a The index for the new array eleme...
-
variable.default.resource.type
...ing that $smarty- display('index.tpl') and $smarty- display('file:index.tpl') ar...
-
language.variables.smarty
... Note Although Smarty provides direct access to PHP super globals for convenienc...
...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
...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
...= $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
...r this also seriously degrades performance. $force_compile is meant to be used f...
...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
...Name Type Required Default Description loop array Yes n/a Array of data to loop ...
...dd"') ); $smarty- display('index.tpl'); ? The variables assigned from php could ...
-
advanced.features.template.settings
...= $smarty- createTemplate('index.tpl); $tpl- cache_lifetime = 600; //or $tpl- se...
-
language.function.foreach
...h loop. Option Flags: Name Description nocache Disables caching of the {foreach}...
... {foreach} properties are @index , @iteration , @first , @last , @show , @total ...
-
caching.custom
...L, * PRIMARY KEY (`id`), * INDEX(`name`), * INDEX(`cache_id`), * INDEX(`compile_...
-
troubleshooting
...atever reason, this is the desired behaviour of your custom error handler, pleas...
...rrors 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...
-
plugins.resources
...pt $smarty- display("mysql:index.tpl"); ? And from within Smarty template: {incl...
-
language.modifier.strip
... one."); $smarty- display('index.tpl'); ? Where template is: {$articleTitle} {$a...
-
caching.cacheable
...); if (!$smarty- isCached('index.tpl')) { // fetch $obj from db and assign... $s...
-
caching.groups
...structure like themes/blue/index.tpl and you want to be able to clear all the ca...
-
language.variables
...II. Smarty For Template Designers  Next Chapter 4. Variables Table ...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
-
advanced.features.postfilters
...mment'); $smarty- display('index.tpl'); ? The postfilter above will make the com...
-
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
...Name Type Required Default Description var string Yes n/a The name of the variab...
...ole_page = $smarty- fetch('index.tpl'); // this will output 'smarty' as the temp...
-
caching.multiple.caches
...ay that a call to display('index.tpl') may have several different output content...
-
resources.custom
...pt $smarty- display("mysql:index.tpl"); ? And from within Smarty template: {incl...
-
plugins.compiler.functions
...hing like this: ?php echo 'index.tpl compiled at 2002-02-20 20:02'; ? See also r...
-
installing.smarty.extended
... a new directory /php/includes/guestbook/ and make a new file called setup.php ....
...; } } ? Now lets alter the index.php file to use setup.php : Example 2.11.Â...
-
tips.componentized.templates
...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
...up II. Smarty For Template Designers 3. Basic Syntax Comments Variables Function...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
-
advanced.features.objects
...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 ...
-
api.clear.compiled.tpl
...pecified template resource Description void clearCompiledTemplate ( stringÂ...
...ty- clearCompiledTemplate('index.tpl'); // clear entire compile directory $smart...
-
language.function.section
...Name Type Required Default Description name string Yes n/a The name of the secti...
... looping over sequentially indexed arrays of data , unlike {foreach} which is us...
-
resources
...pace conflicts and get the desired results. Example 16.4. Using templates ...
...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
...ments'); $smarty- display('index.tpl'); ? See also registerFilter() , postfilter...