-
language.variables.smarty
...Example 4.8. Displaying request variables {* display value of page from UR...
...iables {* display value of page from URL ($_GET) http://www.example.com/index.ph...
...Example 4.8. Displaying request variables {* display value of page from UR...
...ET) http://www.example.com/index.php?page=foo *} {$smarty.get.page} {* display t...
-
api.template.exists
...l templateExists ( string template ); It can accept either a path to the...
...) This example uses $_GET['page'] to {include} a content template. If the templa...
...l templateExists ( string template ); It can accept either a path to the...
...php // set the filename eg index.inc.tpl $mid_template = $_GET['page'].'.inc.tpl...
-
caching
... Chapter 15. Caching Chapter 15. Caching chapter, 15, caching Chapte...
...ing the front page of your website that does not change its content very often, ...
...aching Multiple Caches Per Page Cache Groups Controlling Cacheability of Output ...
... Chapter 15. Caching Chapter 15. Caching chapter, 15, caching Chapte...
...URRENT); $smarty- display('index.tpl'); ? With caching enabled, the function cal...
-
troubleshooting
...ter 20. Troubleshooting Chapter 20. Troubleshooting chapter, 20, tro...
...dir is not writable by the web server. See the bottom of the installing smarty p...
...m of the installing smarty page for more about permissions. Fatal error: Smarty ...
...ter 20. Troubleshooting Chapter 20. Troubleshooting chapter, 20, tro...
...rrors Warning: Smarty: [in index.tpl line 4]: syntax error: unknown tag - '%blah...
-
caching.cacheable
... Controlling Cacheability of Output Controlling Cacheability of Output controlli...
... whole final output of the page gets cached. However Smarty3 offers several opti...
... Controlling Cacheability of Output Controlling Cacheability of Output controlli...
...); if (!$smarty- isCached('index.tpl')) { // fetch $obj from db and assign... $s...
-
caching.multiple.caches
... Chapter 15. Caching  Next Multiple Caches Per Page You can have mu...
...sing values from a client (web browser) into Smarty or any PHP application. Alth...
... Multiple Caches Per Page Multiple Caches Per Page multiple, caches, per, page M...
... Chapter 15. Caching  Next Multiple Caches Per Page You can have mu...
...ay that a call to display('index.tpl') may have several different output content...
-
index
... Next Smarty - the compiling PHP template engine Monte Ohrt monte at ohrt dot c...
...directories writable 2.8. /web/www.example.com/guestbook/templates/index.tpl 2.9...
...aching Multiple Caches Per Page Cache Groups Controlling Cacheability of Output ...
... Next Smarty - the compiling PHP template engine Monte Ohrt monte at ohrt dot c...
...m Uwe Tews uwe dot tews at googlemail dot com Copyright © 2001-2011 New Digit...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
-
language.function.html.select.time
... a unique timestamp, a string of the format YYYYMMDDHHMMSS or a string that is p...
...ct_date} and the date tips page . Prev  Up  Next {html_select_date} ...
... a unique timestamp, a string of the format YYYYMMDDHHMMSS or a string that is p...
-
installing.smarty.basic
...T edit. They are shared among all applications and only get changed when you upg...
.../ for *nix machines and c:\webroot\libs\Smarty-v.e.r\ for the windows environmen...
...T edit. They are shared among all applications and only get changed when you upg...
...com/ guestbook/ templates/ index.tpl templates_c/ configs/ cache/ htdocs/ index....
-
api.get.tags
...y template Description string getTags ( object template ); This function...
...y template Description string getTags ( object template ); This function...
...= $smarty- createTemplate('index.tpl'); // get tags $tags = $smarty- getTags($tp...
-
language.function.append
...{append} is used for creating or appending template variable arrays during the e...
...{append} is used for creating or appending template variable arrays during the e...
...a The value being assigned index string No n/a The index for the new array eleme...
-
variable.default.resource.type
...fault value is file , meaning that $smarty- display('index.tpl') and $smarty- di...
...fault value is file , meaning that $smarty- display('index.tpl') and $smarty- di...
...ing that $smarty- display('index.tpl') and $smarty- display('file:index.tpl') ar...
-
smarty.for.designers
...unctions Attributes Embedding Vars in Double Quotes Math Escaping Smarty Parsing...
...unctions Attributes Embedding Vars in Double Quotes Math Escaping Smarty Parsing...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
-
language.syntax.variables
...d referenced with surrounding #hashmarks#, or via the $smarty.config variable. E...
...d referenced with surrounding #hashmarks#, or via the $smarty.config variable. E...
...ou can reference arrays by index numerically or non-numerically. Also reference ...
-
api.assign.by.ref
...void assignByRef ( string varname ,          ...
...void assignByRef ( string varname ,          ...
...ul if you want a PHP array index value to be affected by its reassignment from a...
-
language.function.html.select.date
...ult Description prefix string No Date_ What to prefix the var name with time tim...
... function on the date tips page for converting {html_select_date} form values to...
...ult Description prefix string No Date_ What to prefix the var name with time tim...
-
language.variable.scopes
... variable scope. By assigning variables to individual data or template objects y...
... variable scope. By assigning variables to individual data or template objects y...
...= $smarty- createTemplate('index.tpl'); $tpl- assign('bar','bar-template'); // a...
-
api.create.template
...e createTemplate ( string template ,         Â...
...the same template, such as pages for displaying different products. See also the...
...e createTemplate ( string template ,         Â...
...= $smarty- createTemplate('index.tpl'); // assign variable to template scope $tp...
-
language.function.nocache
...e} is used to disable caching of a template section. Every {nocache} must be pai...
...assigned from PHP when the page is loaded from the cache. Example 7.60. Pr...
...e} is used to disable caching of a template section. Every {nocache} must be pai...
-
api.append.by.ref
...void appendByRef ( string varname ,          ...
...void appendByRef ( string varname ,          ...
...ul if you want a PHP array index value to be affected by its reassignment from a...
-
advanced.features.template.inheritance
...Inheritance Inheritance brings the concept of Object Oriented Programming to tem...
... {block name=title}Default Page Title{/block} /title {block name=head}{/block} /...
...Inheritance Inheritance brings the concept of Object Oriented Programming to tem...
-
language.function.config.load
...fig_load} is used for loading config #variables# from a configuration file into ...
...comment # global variables pageTitle = "Main Menu" bodyBgColor = #000000 tableBg...
...fig_load} is used for loading config #variables# from a configuration file into ...
-
language.function.eval
...e. This can be used for things like embedding template tags/variables into varia...
...lcome to {$company}'s home page! ErrorCity = You must supply a {#emphstart#}city...
...e. This can be used for things like embedding template tags/variables into varia...
-
api.is.cached
...on bool isCached ( string template ,         Â...
...sCached('index.tpl', 'FrontPage')) { // do database calls, assign vars here } $s...
...on bool isCached ( string template ,         Â...
...T); if(!$smarty- isCached('index.tpl')) { // do database calls, assign vars here...
-
language.builtin.functions
...rt of the smarty template engine. They are compiled into corresponding inline PH...
...rt of the smarty template engine. They are compiled into corresponding inline PH...
...} {foreach},{foreachelse} @index @iteration @first @last @show @total {break} {c...
-
language.function.html.table
...arated list of column heading names or an array of column heading names.if the c...
...arated list of column heading names or an array of column heading names.if the c...
...dd"') ); $smarty- display('index.tpl'); ? The variables assigned from php could ...
-
resources.string
... String Template Resources String Template Resources string, template, resources...
...mplate source every time a page is rendered. This is a good choice for strings w...
... String Template Resources String Template Resources string, template, resources...
-
advanced.features.template.settings
... Changing settings by template Changing settings by template changing, settings,...
... Changing settings by template Changing settings by template changing, settings,...
...= $smarty- createTemplate('index.tpl); $tpl- cache_lifetime = 600; //or $tpl- se...
-
language.function.foreach
...{foreach} is used for looping over arrays of data. {foreach} has a simpler and c...
...{foreach} is used for looping over arrays of data. {foreach} has a simpler and c...
... {foreach} properties are @index , @iteration , @first , @last , @show , @total ...
-
caching.custom
... Chapter 15. Caching  Next Custom Cache Implementation As an altern...
... Chapter 15. Caching  Next Custom Cache Implementation As an altern...
...L, * PRIMARY KEY (`id`), * INDEX(`name`), * INDEX(`cache_id`), * INDEX(`compile_...
-
chapter.debugging.console
... Chapter 10. Debugging Console Chapter 10. Debugging Console chapter...
...efault). When you load the page, a Javascript console window will pop up and giv...
... Chapter 10. Debugging Console Chapter 10. Debugging Console chapter...
-
preface
...rty? Smarty is a template engine for PHP, facilitating the separation of present...
...restrictions on templates. Web designers and PHP A common question: "Web designe...
...the header/footer on a per-page basis. With template inheritance, instead of inc...
...rty? Smarty is a template engine for PHP, facilitating the separation of present...
-
tips.passing.vars
... Passing variable title to header template Passing variable title to header temp...
...t title, depending on what page you are coming from? You can pass the title to t...
... Passing variable title to header template Passing variable title to header temp...
-
advanced.features.outputfilters
...he plugins directory by using the loadFilter() method or by setting the $autoloa...
...he plugins directory by using the loadFilter() method or by setting the $autoloa...
...email"); $smarty- display("index.tpl'); // now any occurrence of an email addres...
-
smarty.for.programmers
...Contents 11. Charset Encoding Charset Encoding 12. Constants SMARTY_DIR 13. Smar...
...aching Multiple Caches Per Page Cache Groups Controlling Cacheability of Output ...
...Contents 11. Charset Encoding Charset Encoding 12. Constants SMARTY_DIR 13. Smar...
-
plugins.resources
... Chapter 18. Extending Smarty With Plugins  Next Resources Resource p...
... Chapter 18. Extending Smarty With Plugins  Next Resources Resource p...
...pt $smarty- display("mysql:index.tpl"); ? And from within Smarty template: {incl...
-
language.function.block
...will replace the correponding areas in the parent template(s). Optionally {block...
...tpl"} {block name="title"} Page Title {/block} The result would look like html h...
...will replace the correponding areas in the parent template(s). Optionally {block...
-
language.modifier.strip
...newlines and tabs with a single space, or with the supplied string. Note If you ...
...newlines and tabs with a single space, or with the supplied string. Note If you ...
... one."); $smarty- display('index.tpl'); ? Where template is: {$articleTitle} {$a...
-
what.is.smarty
...ev  Part I. Getting Started  Next Chapter 1. What is Smarty?...
...t's say you are creating a web page that is displaying a newspaper article. The ...
...say you are creating a web page that is displaying a newspaper article. The arti...
...ev  Part I. Getting Started  Next Chapter 1. What is Smarty?...
-
caching.groups
... Chapter 15. Caching  Next Cache Groups You can do more elaborate g...
... Next Multiple Caches Per Page Home  Controlling Cacheability of Output ...
... Chapter 15. Caching  Next Cache Groups You can do more elaborate g...
...structure like themes/blue/index.tpl and you want to be able to clear all the ca...
-
language.variables
... so that it is the only thing contained between them. Example 4.1. Example...
... so that it is the only thing contained between them. Example 4.1. Example...
...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
-
advanced.features.postfilters
...he plugins directory by using the loadFilter() function or by setting the $autol...
...he plugins directory by using the loadFilter() function or by setting the $autol...
...mment'); $smarty- display('index.tpl'); ? The postfilter above will make the com...
-
language.modifier.escape
...variable to html , url , single quotes , hex , hexentity , javascript and mail ....
...cation *} a href="$my_path?page=foo rewind=$my_uri|urlencode}" click here /a Thi...
...variable to html , url , single quotes , hex , hexentity , javascript and mail ....
-
api.fetch
...ate output Description string fetch ( string template ,     ...
...ate output Description string fetch ( string template ,     ...
... $output = $smarty- fetch('index.tpl', $cache_id); // do something with $output ...
-
api.display
...ion void display ( string template ,         Â...
...ion void display ( string template ,         Â...
...ist if(!$smarty- isCached('index.tpl')) { // dummy up some data $address = '245 ...
-
language.function.assign
...assign} is used for assigning template variables during the execution of a templ...
...plate to a variable $whole_page = $smarty- fetch('index.tpl'); // this will outp...
...assign} is used for assigning template variables during the execution of a templ...
...ole_page = $smarty- fetch('index.tpl'); // this will output 'smarty' as the temp...
-
language.function.literal
...te delimiter syntax. Anything within {literal}{/literal} tags is not interpreted...
...he escaping Smarty parsing page. Prev  Up  Next {ldelim},{rdelim} Ho...
...te delimiter syntax. Anything within {literal}{/literal} tags is not interpreted...
-
resources.custom
... can retrieve templates using whatever possible source you can access with PHP: ...
... can retrieve templates using whatever possible source you can access with PHP: ...
...pt $smarty- display("mysql:index.tpl"); ? And from within Smarty template: {incl...
-
plugins.compiler.functions
... Chapter 18. Extending Smarty With Plugins  Next Compiler Functions C...
... Chapter 18. Extending Smarty With Plugins  Next Compiler Functions C...
...hing like this: ?php echo 'index.tpl compiled at 2002-02-20 20:02'; ? See also r...
-
language.function.debug
...gardless of the debug settings in the php script. Since this gets executed at ru...
...s the debug console to the page. This works regardless of the debug settings in ...
...gardless of the debug settings in the php script. Since this gets executed at ru...
-
installing.smarty.extended
...instead of repeatedly setting directory paths, assigning the same vars, etc., we...
...); $this- setTemplateDir('/web/www.example.com/guestbook/templates/'); $this- se...
...instead of repeatedly setting directory paths, assigning the same vars, etc., we...
...; } } ? Now lets alter the index.php file to use setup.php : Example 2.11.Â...
-
tips.componentized.templates
...es Traditionally, programming templates into your applications goes as follows: ...
...es Traditionally, programming templates into your applications goes as follows: ...
...sign'], $ticker_info); } ? index.tpl {load_ticker symbol='SMARTY' assign='ticker...
-
api.register.resource
... registerResource ( string name ,          Â...
... registerResource ( string name ,          Â...
...marty- display('c:/path/to/index.tpl'); Note Prior to Smarty 3.1 registerResourc...
-
language.function.fetch
...be sure to include a trailing slash on your web page fetches where necessary. If...
... begins with http:// , the web site page will be fetched and displayed. Note Thi...
...ith http:// , the web site page will be fetched and displayed. Note This will no...
...be sure to include a trailing slash on your web page fetches where necessary. If...
-
api.get.registered.object
... getRegisteredObject ( string object_name ); This is useful from within a cu...
...d object . See the objects page for more info. Example 14.28. getRegistere...
... getRegisteredObject ( string object_name ); This is useful from within a cu...
-
advanced.features.objects
...ns can be accessed (beginningwith '_'). If a method and property of the same nam...
...ices section of the Smarty website. There are two ways to access them. One way i...
...ns can be accessed (beginningwith '_'). If a method and property of the same nam...
...$myobj); $smarty- display('index.tpl'); ? And here's how to access your objects ...
-
api.clear.compiled.tpl
...learCompiledTemplate ( string tpl_file ,         Â...
...learCompiledTemplate ( string tpl_file ,         Â...
...ty- clearCompiledTemplate('index.tpl'); // clear entire compile directory $smart...
-
language.function.include
...} tags are used for including other templates in the current template. Any varia...
... /head body {include file='page_header.tpl'} {* body of template goes here, the ...
...} tags are used for including other templates in the current template. Any varia...
-
language.modifier.date.format
...ysql timestamps or any string made up of month day year, parsable by php's strto...
...ed. Check your system's manpage for a full list of valid specifiers. However, a ...
...ysql timestamps or any string made up of month day year, parsable by php's strto...
-
language.function.section
...e} A {section} is for looping over sequentially indexed arrays of data , unlike ...
...l'), array( 'home phone', 'web'), array( 'cell phone') ); $smarty- assign('conta...
...e} A {section} is for looping over sequentially indexed arrays of data , unlike ...
... looping over sequentially indexed arrays of data , unlike {foreach} which is us...
-
resources
...tory Windows Filepaths String Template Resources Stream Template Resources Exten...
...template_dir . This allows websites employing multiple sets of templates better ...
...tory Windows Filepaths String Template Resources Stream Template Resources Exten...
...dir ?php $smarty- display('index.tpl'); $smarty- display('file:index.tpl'); // s...
-
language.function.insert
... cached when template caching is enabled. They will be executed on every invocat...
...ner slot at the top of the page. The banner can contain any mixture of HTML, ima...
... cached when template caching is enabled. They will be executed on every invocat...
-
api.clear.all.cache
... , isCached() and the caching page. Prev  Up  Next clearAllAssign() ...
...isCached() and the caching page. Prev  Up  Next clearAllAssign() Hom...
... , isCached() and the caching page. Prev  Up  Next clearAllAssign() ...
-
api.create.data
...ata object Description string createData ( object parent ); string c...
...ata object Description string createData ( object parent ); string c...
...= $smarty- createTemplate('index.tpl',$data); // display the template $tpl- disp...
-
api.clear.cache
... void clearCache ( string template ,         Â...
... void clearCache ( string template ,         Â...
...plate $smarty- clearCache('index.tpl'); // clear the cache for a particular cach...
-
advanced.features.prefilters
...his is good for preprocessing your templates to remove unwanted comments, keepin...
...his is good for preprocessing your templates to remove unwanted comments, keepin...
...ments'); $smarty- display('index.tpl'); ? See also registerFilter() , postfilter...