-
caching
...Cacheability of Plugins Custom Cache Implementation Caching is used to speed up ...
...ignments here. $contents = get_database_contents(); $smarty- assign($contents); ...
...Cacheability of Plugins Custom Cache Implementation Caching is used to speed up ...
...URRENT); $smarty- display('index.tpl'); ? With caching enabled, the function cal...
...ith a timetable containing new information by the minute, it would not make sens...
... 15. Caching Table of Contents Setting Up Caching Multiple Caches Per Page ...
... 15. Caching Table of Contents Setting Up Caching Multiple Caches Per Page C...
...splaying the front page of your website that does not change its content very of...
...ing the front page of your website that does not change its content very often, ...
-
preface
...d designers quick and easy to maintain syntax easy to understand, no PHP knowled...
...tegration Sometimes Smarty gets compared to Model-View-Controller (MVC) framewor...
...d designers quick and easy to maintain syntax easy to understand, no PHP knowled...
...ce Template inheritance is new to Smarty 3, and it's one of many great new featu...
...indicate where application content is revealed. This approach is common with oth...
...these goals: clean separation of presentation from application code PHP backend,...
...esentation. Smarty focuses your templates on presentation and less on "code". Th...
...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...
... same way custom functions get them. An associative array is passed as the first...
...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 ...
...is my meth1'; } } $myobj = new My_Object; // registering the object (will be by ...
...four parameters $params , $content , $smarty and $repeat and they also behave li...
...template are for presentation purposes only. It is very easy to inject applicati...
...oose will be determined by your needs, but use the first method whenever possibl...
...ices section of the Smarty website. There are two ways to access them. One way i...
-
api.template.exists
...t can accept either a path to the template on the filesystem or a resource strin...
...ists() This example uses $_GET['page'] to {include} a content template. If the t...
...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...
...GET['page'] to {include} a content template. If the template does not exist then...
...d template exists Description bool templateExists ( string template ); I...
-
api.create.template
...ce instead of passing this to each call to this function. It is used in the even...
...e pairs of variables which get assigned to the object. Example 14.18. crea...
...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...
...rty.class.php'); $smarty = new Smarty; // create template object with its privat...
...ou want to cache different content of the same template, such as pages for displ...
...a template object Description Smarty_Internal_Template createTemplate ( stri...
-
caching.custom
... Custom Cache Implementation Custom Cache Implementation custom, cache, implemen...
...l Resource failed: ' . $e- getMessage()); } $this- fetch = $this- db- prepare('S...
... Custom Cache Implementation Custom Cache Implementation custom, cache, implemen...
...L, * PRIMARY KEY (`id`), * INDEX(`name`), * INDEX(`cache_id`), * INDEX(`compile_...
...arty.class.php'; $smarty = new Smarty(); $smarty- caching_type = 'mysql'; /** * ...
...AULT CURRENT_TIMESTAMP, * `content` LONGTEXT NOT NULL, * PRIMARY KEY (`id`), * I...
... Custom Cache Implementation Custom Cache Implementation custom, cache, implemen...
...ead, write, clear calls to your implementation. This API allows you to store whe...
-
plugins.resources
...s or PHP script components to Smarty. Some examples of resources: databases, LDA...
...ss via $_template- smarty- getTemplateVars() . These Resources simply echo their...
...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...
...ruct() { try { $this- db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty",...
...simply echo their rendered content to the output stream. The rendered output wil...
... sources or PHP script components to Smarty. Some examples of resources: databas...
...ource.foobarxyz.php within your $plugins_dir , or registered on runtime with reg...
-
caching.cacheable
...offers several options how to exclude sections of your output from caching. Gene...
...e final output of the page gets cached. However Smarty3 offers several options h...
...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...
...rty_block_dynamic($param, $content, $smarty) { return $content; } $smarty- regis...
... Controlling Cacheability of Output Controlling Cacheability of Output controlli...
...how to exclude sections of your output from caching. General Note Be sure any va...
-
what.is.smarty
...cilitates a manageable way to separate application logic and content from its pr...
...y? Prev  Part I. Getting Started  Next Chapter 1. What is Sm...
...cilitates a manageable way to separate application logic and content from its pr...
... page that is displaying a newspaper article. The article $headline , $tagline ,...
...rate application logic and content from its presentation. This is best described...
...e way to separate application logic and content from its presentation. This is b...
...s logic in the template is your own doing. Also, if you desire no logic in your ...
-
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...
...ty! -- {* rest of template content... *} See also registerFilter() , prefilters ...
... postfilters are PHP functions that your templates are ran through after they ar...
...ers are PHP functions that your templates are ran through after they are compile...
-
plugins.compiler.functions
...sensitive static content into the template. If there is both a compiler function...
...plate as: {* this function gets executed at compile time only *} {tplheader} The...
...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...
...e or time-sensitive static content into the template. If there is both a compile...
... Compiler Functions Compiler Functions compiler, functions Compiler Functions Pr...
-
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...
...om plugin for fetching the content and assigning it to a template variable. Exam...
... Componentized Templates Componentized Templates componentized, templates Compon...
...programming templates into your applications goes as follows: First, you accumul...
-
index
...ng_format strip strip_tags to_charset truncate unescape upper wordwrap 6. Combin...
...ble of Contents Preface I. Getting Started 1. What is Smarty? 2. Installation Re...
...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...
...m Copyright © 2001-2011 New Digital Group, Inc. 2011-11-29 Table of Contents ...
..., Inc. 2011-11-29 Table of Contents Preface I. Getting Started 1. What is Smarty...
...iling PHP template engine Monte Ohrt monte at ohrt dot com Uwe Tews uwe dot tews...
-
installing.smarty.basic
...are in the /libs/ sub directory of the distribution. These are .php files that y...
... all applications and only get changed when you upgrade to a new version of Smar...
...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....
...nged when you upgrade to a new version of Smarty. In the examples below the Smar...
... Basic Installation Basic Installation basic, installation Basic Installation Pr...
.../ directory. Basically, if your application can find the Smarty.class.php file, ...
-
api.get.tags
... getTags() getTags() gettags, getTags() Prev  Chapter 14. Smarty Class...
...= $smarty- createTemplate('index.tpl'); // get tags $tags = $smarty- getTags($tp...
...rty.class.php'); $smarty = new Smarty; // create template object $tpl = $smarty-...
... used by template Description string getTags ( object template ); This f...
-
language.function.append
...lacing application logic into the presentation that may be better handled in PHP...
...yer. See also append() and getTemplateVars() . Prev  Up  Next ChapterÂ...
...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...
...g No n/a The index for the new array element. If not specified the value is appe...
...er 7. Built-in Functions  Next {append} {append} is used for creating ...
...ter handled in PHP. Use at your own discretion. Attributes: Attribute Name Type ...
-
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...
...ers Home  $default_config_handler_func ...
-
language.variables.smarty
...arty} variable can be used to access several environment and request variables. ...
...equest variables such as $_GET , $_POST , $_COOKIE , $_SERVER , $_ENV and $_SESS...
...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...
...is no longer used with the new {foreach} syntax, but is still supported with Sma...
...sed to access several environment and request variables. The full list of them f...
-
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...
...emplate Designers Table of Contents 3. Basic Syntax Comments Variables Functions...
...mplate Designers Table of Contents 3. Basic Syntax Comments Variables Functions ...
-
language.syntax.variables
...variables are an exception to the $dollar syntax and are instead referenced with...
... find your template syntax getting too complex, it may be a good idea to move th...
...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 ...
...he $dollar sign. They can contain numbers, letters and underscores, much like a ...
... presentation. If you find your template syntax getting too complex, it may be a...
-
api.assign.by.ref
...ed var ); This is used to assign() values to the templates by reference. Tec...
... , append() , {assign} and getTemplateVars() . Prev  Up  Next assign()Â...
...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...
...lues by reference Description void assignByRef ( string varname ,  Â...
-
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...
...ate objects you have full control which variables can be seen by a template. Exa...
-
language.escaping
...esirable or even necessary to have Smarty ignore sections it would otherwise par...
...or avoiding escapement altogether is by separating your Javascript/CSS into thei...
...esirable or even necessary to have Smarty ignore sections it would otherwise par...
...y represent presentational content. However if another set of delimiters suit yo...
...to have Smarty ignore sections it would otherwise parse. A classic example is em...
...ltogether is by separating your Javascript/CSS into their own files and use stan...
-
api.append.by.ref
... merge ); This is used to append() values to the templates by reference. Tec...
...so append() , assign() and getTemplateVars() . Prev  Up  Next append()Â...
... 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...
...lues by reference Description void appendByRef ( string varname ,  Â...
-
advanced.features.template.inheritance
...bject Oriented Programming to templates, allowing you to define one (or more) ba...
...bject Oriented Programming to templates, allowing you to define one (or more) ba...
...mplates can not define any content besides what's inside {block} tags they overr...
...ce Inheritance brings the concept of Object Oriented Programming to templates, a...
...ne the inheritance tree in your PHP script by using the extends: resource type. ...
-
language.function.eval
...v  Chapter 8. Custom Functions  Next {eval} {eval} is used to eval...
...v  Chapter 8. Custom Functions  Next {eval} {eval} is used to eval...
...st of the template. If the content to evaluate doesn't change often, or is used ...
...pter 8. Custom Functions  Next {eval} {eval} is used to evaluate a var...
-
api.is.cached
...y works if $caching is set to one of Smarty::CACHING_LIFETIME_CURRENT or Smarty:...
...n . Prev  Up  Next getTemplateVars() Home  loadFilter() ...
...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...
...for this template Description bool isCached ( string template ,   ...
-
language.basic.syntax
...template tags, it attempts to interpret them, and displays the appropriate outpu...
...template tags, it attempts to interpret them, and displays the appropriate outpu...
.... Basic Syntax Table of Contents Comments Variables Functions Attributes Embe...
... Basic Syntax Table of Contents Comments Variables Functions Attributes Embed...
-
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...
...uilt-in Functions Table of Contents {$var=...} {append} {assign} {block} {call} ...
...er 7. Built-in Functions Chapter 7. Built-in Functions chapter, 7, b...
...ormance. You cannot create your own custom functions with the same name; and you...
-
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 ...
...pter 8. Custom Functions  Next {html_table} {html_table} is a custom f...
-
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...
... by template Normally you configure the Smarty settings by modifying the Smarty ...
-
bugs
... with the latest distribution of Smarty, or check the website. Prev  Up  ...
...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 ...
...attributes. This syntax is new to Smarty 3, however the Smarty 2.x syntax {forea...
...er 7. Built-in Functions  Next {foreach},{foreachelse} {foreach} is us...
-
language.function.html.checkboxes
...v  Chapter 8. Custom Functions  Next {html_checkboxes} {html_check...
...ssign('contact_types',$db- getAssoc($sql)); $sql = 'select contact_id, contact_t...
...v  Chapter 8. Custom Functions  Next {html_checkboxes} {html_check...
...o TRUE Escape the output / content (values are always escaped) Required attribut...
...pter 8. Custom Functions  Next {html_checkboxes} {html_checkboxes} is ...
-
language.function.extends
...tax for template resources to extend files outside of the $template_dir director...
...tax for template resources to extend files outside of the $template_dir director...
...} tags. Any other template content is ignored. Use the syntax for template resou...
...er 7. Built-in Functions  Next {extends} {extends} tags are used in ch...
-
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...
... Troubleshooting Table of Contents Smarty/PHP errors Smarty/PHP errors Smarty c...
...Troubleshooting Table of Contents Smarty/PHP errors Smarty/PHP errors Smarty ca...
...source.php This means that your application registered a custom error hander (us...
-
plugins.block.functions
...ns take precedence over custom functions of the same name, that is, you cannot h...
...ns take precedence over custom functions of the same name, that is, you cannot h...
...n is called again with the new block contents in the parameter $content . If you...
...ame ( $params , Â Â $content , Â Â $template , Â Â $repeat ) ;...
... Block Functions Block Functions block, functions Block Functions Prev  Chap...
...unc}..{/func} . By default your function implementation is called twice by Smart...
-
variable.cache.modified.check
...ache_modified_check If set to TRUE , Smarty will respect the If-Modified-Since h...
...ache_modified_check If set to TRUE , Smarty will respect the If-Modified-Since h...
...ill be sent instead of the content. This works only on cached content without {i...
...ll be sent instead of the content. This works only on cached content without {in...
-
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...
...es the underlying application code structure directly to the presentation, and a...
...HP classes/objects. Use at your own discretion. See the Best Practices section o...
...ices section of the Smarty website. Example 17.10. static class access syn...
-
variable.caching
...ells Smarty whether or not to cache the output of the templates to the $cache_di...
...ells Smarty whether or not to cache the output of the templates to the $cache_di...
...istently generate the same content, it is advisable to turn on $caching , as thi...
...efault this is set to the constant Smarty::CACHING_OFF. If your templates consis...
...nt Smarty::CACHING_OFF. If your templates consistently generate the same content...
-
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...
...output can be sent through one or more output filters. This differs from postfil...
...filter ?php // put this in your application function protect_email($tpl_output, ...
-
language.function.block
...xt {block} {block} is used to define a named area of template source for templat...
...xt {block} {block} is used to define a named area of template source for templat...
...prepend the parent {block} content by using the append or prepend option flag wi...
...er 7. Built-in Functions  Next {block} {block} is used to define a nam...
-
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...
...laces all repeated spaces, newlines and tabs with a single space, or with the su...
...the built-in {strip} function. Example 5.19. strip ?php $smarty- assign('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...
...rty.class.php'); $smarty = new Smarty; $smarty- setCaching(Smarty::CACHING_LIFET...
...ouping works left-to-right ONLY. You will need to group your templates under a s...
...LY. You will need to group your templates under a single cache group heirarchy t...
-
api.assign
... assign variables/objects to the templates Description void assign ( mixed...
...ty- assign('contact', $db- getRow($sql)); ? These are accessed in the template w...
... assign variables/objects to the templates Description void assign ( mixed...
... to the templates Description void assign ( mixed var ); void assign...
...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...
...es PHP code ?php $smarty = new Smarty(); $smarty- assign('firstname', 'Doug'); $...
... 4. Variables Table of Contents Variables assigned from PHP Associative arra...
...4. Variables Table of Contents Variables assigned from PHP Associative array...
-
api.fetch
...in the event that you want to compile different versions of the same template, s...
...t that would automatically get wrapped at 40 characters. This helps make the tex...
...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 ...
...rty.class.php'); $smarty = new Smarty; $smarty- setCaching(true); // set a separ...
...e template output Description string fetch ( string template ,   ...
...e link below to login with your user name of '{$contact_info.username}' so you c...
-
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 ...
...rty.class.php'); $smarty = new Smarty(); $smarty- setCaching(true); // only do d...
...le_id ); This displays the contents of a template. To return the contents of a t...
...lays the template Description void display ( string template ,   ...
-
language.function.assign
...lacing application logic into the presentation that may be better handled in PHP...
...bles from a php script use getTemplateVars() . Here's the template that creates ...
...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...
...er 7. Built-in Functions  Next {assign} {assign} is used for assigning...
...ter handled in PHP. Use at your own discretion. Note See also the short-form met...
-
caching.multiple.caches
...he files for a single call to display() or fetch() . Let's say that a call to di...
...CURRENT); $my_cache_id = $_GET['article_id']; $smarty- display('index.tpl', $my_...
...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...
...rty.class.php'); $smarty = new Smarty; $smarty- setCaching(Smarty::CACHING_LIFET...
...e several different output contents depending on some condition, and you want se...
... several different output contents depending on some condition, and you want sep...
... can “ group †your caches together by giving them the same $cache_i...
-
language.function.html.radios
...v  Chapter 8. Custom Functions  Next {html_radios} {html_radios} i...
...ssign('contact_types',$db- getAssoc($sql)); $sql = 'select contact_id, name, ema...
...v  Chapter 8. Custom Functions  Next {html_radios} {html_radios} i...
...o TRUE Escape the output / content (values are always escaped) Required attribut...
...pter 8. Custom Functions  Next {html_radios} {html_radios} is a custom...
-
resources.custom
... Custom Template Resources Custom Template Resources custom, template, resources...
...l Resource failed: ' . $e- getMessage()); } $this- fetch = $this- db- prepare('S...
... Custom Template Resources Custom Template Resources custom, template, resources...
...pt $smarty- display("mysql:index.tpl"); ? And from within Smarty template: {incl...
...ruct() { try { $this- db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty",...
...ting resource plugin functions and registering them with Smarty. See resource pl...
-
api.register.object
...ou register/assign objects to templates, be sure that all properties and methods...
...more information. See also getRegisteredObject() , and unregisterObject() . Prev...
...ou register/assign objects to templates, be sure that all properties and methods...
... in the templates Description void registerObject ( string object_name ,...
...ices section of the Smarty website. See the objects section for more information...
-
installing.smarty.extended
...slightly more flexible way to setup Smarty is to extend the class and initialize...
...or. // These automatically get set with each new instance. parent::__construct()...
...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.Â...
...n one place. Lets create a new directory /php/includes/guestbook/ and make a new...
...Chapter 2. Installation  Next Extended Setup This is a continuation of...
...d the class and initialize your Smarty environment. So instead of repeatedly set...
-
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...
... registerResource('mysql', new Smarty_Resource_Mysql()); ? See also unregisterRe...
...egister resources Description void registerResource ( string name ,  ...
-
variable.default.config.handler.func
...s file: resource is unable to load a requested file * * @param string $type reso...
...s file: resource is unable to load a requested file * * @param string $type reso...
...andler_func ?php $smarty = new Smarty(); $smarty- default_config_handler_func = ...
...bar.tpl") * @param string $content config's content * @param integer $modified c...
... $default_config_handler_func $default_config_handler_func , default_config_hand...
-
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...
... clears the compiled version of the specified template resource Description voi...
-
variable.default.template.handler.func
...s file: resource is unable to load a requested file * * @param string $type reso...
...s file: resource is unable to load a requested file * * @param string $type reso...
...andler_func ?php $smarty = new Smarty(); $smarty- default_template_handler_func ...
...bar.tpl") * @param string $content template's content * @param integer $modified...
...te_handler_func This function is called when a template cannot be obtained from ...
-
language.function.section
...ke {foreach} which is used to loop over a single associative array . Every {sect...
...y- assign('contacts', $db- getAll($sql)); ? The template to output the database ...
...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...
... {section},{sectionelse} {section},{sectionelse} , ldelim, section, rdelim, ldel...
-
resources
...ir Templates from any directory Windows Filepaths String Template Resources Stre...
...id namespace conflicts and get the desired results. Example 16.4. Using te...
...ir Templates from any directory Windows Filepaths String Template Resources Stre...
...dir ?php $smarty- display('index.tpl'); $smarty- display('file:index.tpl'); // s...
...16. Resources Table of Contents File Template Resources Templates from $temp...
...16. Resources Table of Contents File Template Resources Templates from $templ...
...template_dir . This allows websites employing multiple sets of templates better ...
-
tips.wap
... a php Content-Type header to be passed along with the template. The easist way ...
... a php Content-Type header to be passed along with the template. The easist way ...
...DTD/wml_1.1.xml" !-- begin new wml deck -- wml !-- begin first card -- card do t...
...ML templates require a php Content-Type header to be passed along with the templ...
...L templates require a php Content-Type header to be passed along with the templa...
...this function somewhere in your application, or in Smarty.addons.php function in...
-
language.function.function
...nction} {function} is used to create functions within a template and call them j...
...nction} {function} is used to create functions within a template and call them j...
...n. Changes to variables or new created variables inside the template function ha...
...t generates presentational content, keeping it in the template is often a more m...
... {function} {function} , ldelim, function, rdelim, {function} Prev  Chapter...
-
language.function.capture
...capture} {capture} is used to collect the output of the template between the tag...
...ort-hand *} {include file="get_banner.tpl"} {/capture} {if $smarty.capture.banne...
...capture} {capture} is used to collect the output of the template between the tag...
...tead of displaying it. Any content between {capture name='foo'} and {/capture} i...
...er 7. Built-in Functions  Next {capture} {capture} is used to collect ...
...r} at {$my_server_addr} br Your ip is {$my_ip}. {/capture} a href="#" {$popText}...
-
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...
...rty.class.php'); $smarty = new Smarty; // create data object with its private va...
...tes a data object Description string createData ( object parent ); strin...
-
api.register.plugin
... $object being a reference to an object and $method being a string containing th...
... $object being a reference to an object and $method being a string containing th...
... do_translation ($params, $content, $smarty, $repeat, $template) { if (isset($co...
... register plugins Description void registerPlugin ( string type ,  Â...
...ions or methods defined in your script as plugin. It uses the following paramete...
-
api.clear.cache
...r. You can group templates together so they can be removed as a group, see the c...
... You can group templates together so they can be removed as a group, see the cac...
...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...
...specific template Description void clearCache ( string template ,  Â...
-
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...
...e prefilters are PHP functions that your templates are ran through before they a...
...ers are PHP functions that your templates are ran through before they are compil...
-
variable.cache.id
...ntifier. As an alternative to passing the same $cache_id to each and every funct...
...ntifier. As an alternative to passing the same $cache_id to each and every funct...
...for example from different content of the same template. See the caching section...
...id to each and every function call, you can set this $cache_id and it will be us...