Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

Search Results for "【W22.My】The fastest time to have Google index your page.250505060236"

  • language.variables.smarty
    ... {$smarty.now} The current timestamp can be accessed with {$smarty.now} . The va...
    ...arty} variable can be used to access several environment and request variables. ...
    ...on} loop properties. These have some very useful values such as .first , .index ...
    ...ET) http://www.example.com/index.php?page=foo *} {$smarty.get.page} {* display t...
  • caching
    ...es with longer computation times. Since the output of display() or fetch() is ca...
    ...Cacheability of Plugins Custom Cache Implementation Caching is used to speed up ...
    ...ation. If any of the files have been modified since the cache was generated, the...
    ...URRENT); $smarty- display('index.tpl'); ? With caching enabled, the function cal...
    ...splaying the front page of your website that does not change its content very of...
  • troubleshooting
    ...ally end up in PHP compile-time parsing errors. Example 20.2. PHP parsing ...
    ... will see an error similar to the following: Example 20.1. Smarty errors W...
    ... find the error, you might have to open the compiled PHP file and go to the line...
    ...rrors Warning: Smarty: [in index.tpl line 4]: syntax error: unknown tag - '%blah...
    ...source.php This means that your application registered a custom error hander (us...
  • caching.cacheable
    ...able $smarty- assign('foo',time(),true); Dynamic time value is {$foo} Cacheabili...
    ...offers several options how to exclude sections of your output from caching. Gene...
    ...che. The plugin function behaves a little like an {insert} function. Note The $c...
    ...); if (!$smarty- isCached('index.tpl')) { // fetch $obj from db and assign... $s...
    ...how to exclude sections of your output from caching. General Note Be sure any va...
  • language.function.html.select.time
    ... {html_select_time} {html_select_time} , ldelim, html_select_time, rdelim, {html...
    ...v   Chapter 8. Custom Functions   Next {html_select_time} {html_sele...
    ...an. The time attribute can have different formats. It can be a unique timestamp,...
  • installing.smarty.basic
    ...y files are in place, it's time to setup the Smarty directories for your applica...
    ...are in the /libs/ sub directory of the distribution. These are .php files that y...
    ...d, welcome to Smarty!" You have completed the basic setup for Smarty! Prev   ...
    ...com/ guestbook/ templates/ index.tpl templates_c/ configs/ cache/ htdocs/ index....
    .../ directory. Basically, if your application can find the Smarty.class.php file, ...
  • api.template.exists
    ...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...
  • language.syntax.variables
    ...rect PHP function access: {time()} Note Although Smarty can handle some very com...
    ...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 ...
    ... presentation. If you find your template syntax getting too complex, it may be a...
  • language.function.html.select.date
    ...o prefix the var name with time timestamp , DateTime , mysql timestamp or any st...
    ...v   Chapter 8. Custom Functions   Next {html_select_date} {html_sele...
  • advanced.features.template.inheritance
    ...e inheritance is a compile time process which creates a single compiled template...
    ...bject Oriented Programming to templates, allowing you to define one (or more) ba...
    ... the {include} tag it does have much better performance when rendering. The chil...
    ...ne the inheritance tree in your PHP script by using the extends: resource type. ...
  • resources.string
    ... the template source every time a page is rendered. This is a good choice for st...
    ...ompiled from a string and stores the compiled template code for later reuse. Eac...
    ...ce. The string: resource behaves much the same as a template file. The template ...
    ...compiled template file. If your template strings are accessed frequently, this i...
  • language.function.foreach
    ..., determines the number of times {foreach} will loop. You can also pass an integ...
    ...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 ...
  • caching.custom
    ..._dir , or registered on runtime with registerCacheResource() . In either case yo...
    ... Custom Cache Implementation Custom Cache Implementation custom, cache, implemen...
    ...L, * PRIMARY KEY (`id`), * INDEX(`name`), * INDEX(`cache_id`), * INDEX(`compile_...
    ...ead, write, clear calls to your implementation. This API allows you to store whe...
  • preface
    ... Although this approach is fastest from a pure script-execution point of view, m...
    ...n, and yet keeps execution times extremely fast since the compiled code is just ...
    ...d designers quick and easy to maintain syntax easy to understand, no PHP knowled...
    ...n question: "Web designers have to learn a syntax anyways, why not PHP?" Of cour...
    ...esentation. Smarty focuses your templates on presentation and less on "code". Th...
  • plugins.resources
    ..._dir , or registered on runtime with registerResource() . In either case you wil...
    ...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...
    ...ource.foobarxyz.php within your $plugins_dir , or registered on runtime with reg...
  • caching.multiple.caches
    ...aching(Smarty::CACHING_LIFETIME_CURRENT); $my_cache_id = $_GET['article_id']; $s...
    ...he files for a single call to display() or fetch() . Let's say that a call to di...
    ...le Caches Per Page You can have multiple cache files for a single call to displa...
    ...ay that a call to display('index.tpl') may have several different output content...
    ... can “ group ” your caches together by giving them the same $cache_i...
  • resources.custom
    ...00) NOT NULL, * `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDAT...
    ... Custom Template Resources Custom Template Resources custom, template, resources...
    ...pt $smarty- display("mysql:index.tpl"); ? And from within Smarty template: {incl...
  • plugins.compiler.functions
    ... for injecting PHP code or time-sensitive static content into the template. If t...
    ...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...
  • index
    ..._select_date} {html_select_time} {html_table} {mailto} {math} {textformat} 9. Co...
    ...ng_format strip strip_tags to_charset truncate unescape upper wordwrap 6. Combin...
    ...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...
  • advanced.features.objects
    ...parameters passed one at a time for each argument like traditional object parame...
    ...jects Smarty allows access to PHP objects through the templates. Note When you a...
    .... That means these methods have a closing tag in the template ( {foobar- meth2}....
    ...$myobj); $smarty- display('index.tpl'); ? And here's how to access your objects ...
    ...oose will be determined by your needs, but use the first method whenever possibl...
  • language.modifier.date.format
    ...at This formats a date and time into the given strftime() format. Dates can be p...
    ... formats a date and time into the given strftime() format. Dates can be passed t...
    ...an then use date_format to have complete control of the formatting of the date. ...
    ...ers available depending on your system's strftime() function where PHP was compi...
  • language.function.insert
    ...will run dynamically every time the page is created, even within cached pages. T...
    ...he output will be assigned to script string No n/a The name of the php script th...
    ...ert function Let's say you have a template with a banner slot at the top of the ...
    ...nd should not be used. Put your PHP logic in PHP scripts or plugin functions ins...
  • variable.cache.lifetime
    ... $cache_lifetime $cache_lifetime , cache_lifetime $cache_lifetime Prev   Chap...
    ...SAVED) for $cache_lifetime to have any purpose. A $cache_lifetime value of -1 wi...
    ...ED) for $cache_lifetime to have any purpose. A $cache_lifetime value of -1 will ...
  • api.get.tags
    ...= $smarty- createTemplate('index.tpl'); // get tags $tags = $smarty- getTags($tp...
  • language.function.append
    ...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...
    ...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...
    ...ing that $smarty- display('index.tpl') and $smarty- display('file:index.tpl') ar...
  • smarty.for.designers
    ..._select_date} {html_select_time} {html_table} {mailto} {math} {textformat} 9. Co...
    ...ng_format strip strip_tags to_charset truncate unescape upper wordwrap 6. Combin...
    ...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
  • api.assign.by.ref
    ...ed  var ); This is used to assign() values to the templates by reference. Tec...
    ...signed object properties behave this way by default. Example 14.7. assignB...
    ...ul if you want a PHP array index value to be affected by its reassignment from a...
  • language.variable.scopes
    ...scopes You have the choice to assign variables to the scope of the main Smarty o...
    ... Next Variable scopes You have the choice to assign variables to the scope of t...
    ...= $smarty- createTemplate('index.tpl'); $tpl- assign('bar','bar-template'); // a...
  • variable.escape.html
    ...ag. Note This is a compile time option. If you change the setting you must make ...
    ..._html Setting $escape_html to TRUE will escape all template variable output by w...
  • api.create.template
    ...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...
  • language.function.nocache
    ...nocache} {nocache} is used to disable caching of a template section. Every {noca...
  • api.append.by.ref
    ...  merge ); This is used to append() values to the templates by reference. Tec...
    ...signed object properties behave this way by default. Technical Note The merge pa...
    ...ul if you want a PHP array index value to be affected by its reassignment from a...
  • variable.compile.id
    ...ependend parts) at compile time, then you could use the current language as $com...
    ...ntifier. As an alternative to passing the same $compile_id to each and every fun...
    ...their $compile_id . If you have for example a prefilter that localizes your temp...
    ...a prefilter that localizes your templates (that is: translates language dependen...
  • language.syntax.quotes
    ...e quotes! {func var="test {time()} test"} // PHP function result {func var="test...
    ...This is useful if you want to include variables with modifiers, plugin or PHP fu...
    ...ire double quotes! {* must have backticks as it contains a dot "." *} {cycle val...
    ... presentation. If you find your template syntax getting too complex, it may be a...
  • language.function.config.load
    ...rom a configuration file into the template. Attributes: Attribute Name Type Requ...
    ... function called {section} have nothing to do with each other, they just happen ...
  • language.function.eval
    ...v   Chapter 8. Custom Functions   Next {eval} {eval} is used to eval...
    ... not saved! However if you have caching enabled, the output will be cached with ...
  • api.is.cached
    ...one of Smarty::CACHING_LIFETIME_CURRENT or Smarty::CACHING_LIFETIME_SAVED to ena...
    ...y works if $caching is set to one of Smarty::CACHING_LIFETIME_CURRENT or Smarty:...
    ... to pass a $compile_id you have to pass NULL as a $cache_id . Technical Note If ...
    ...T); if(!$smarty- isCached('index.tpl')) { // do database calls, assign vars here...
  • language.builtin.functions
    ...ration @first @last @show @total {break} {continue} {function} {if},{elseif},{el...
    .... A few of these functions have an assign attribute which collects the result th...
    ...} {foreach},{foreachelse} @index @iteration @first @last @show @total {break} {c...
    ...ormance. You cannot create your own custom functions with the same name; and you...
  • advanced.features
    ...', 'in_array', 'is_array','time','nl2br'). $php_modifiers is an array of PHP fun...
    ...s eg via ftp, and you want to reduce the risk of system security compromises thr...
    ...od for situations when you have untrusted parties editing the templates eg via f...
    ...late files when you change your security settings. Prev   Up   Next Custom...
  • language.function.html.table
    ... Up   Next {html_select_time}  Home  {mailto} ...
    ...v   Chapter 8. Custom Functions   Next {html_table} {html_table} is ...
    ...dd"') ); $smarty- display('index.tpl'); ? The variables assigned from php could ...
  • advanced.features.template.settings
    ...ndex.tpl); $tpl- cache_lifetime = 600; //or $tpl- setCacheLifetime(600); $smarty...
    ...tions . Modifications done to the Smarty object will be global for all templates...
    ...= $smarty- createTemplate('index.tpl); $tpl- cache_lifetime = 600; //or $tpl- se...
  • plugins.prefilters.postfilters
    ...tion -- more precisely the time of their execution. string smarty_prefilter_name...
    ...;   Prefilters are used to process the source of the template immediately bef...
  • chapter.debugging.console
    ...bug console. Note The load times of each template and config file are in seconds...
    ...he console. Set $debugging to TRUE in Smarty, and if needed set $debug_tpl to th...
  • plugins.block.functions
    ...for it to control how many times the block is displayed. By default $repeat is T...
    ...ns take precedence over custom functions of the same name, that is, you cannot h...
    ... name, that is, you cannot have both custom function {func} and block function {...
    ...unc}..{/func} . By default your function implementation is called twice by Smart...
  • tips.default.var.handling
    ...the default modifier every time it is mentioned can get a bit ugly. You can reme...
    ...* do this somewhere at the top of your template *} {assign var='title' value=$ti...
    ...used frequently throughout your templates, applying the default modifier every t...
  • variable.locking.timeout
    ... $locking_timeout $locking_timeout , locking_timeout $locking_timeout Prev   ...
    ...onds a cache lock is valid to avoid dead locks. The deafult value is 10 seconds....
  • tips.passing.vars
    ... Passing variable title to header template Passing variable title to header temp...
    ...hat if the header needs to have a different title, depending on what page you ar...
    ...plate When the majority of your templates use the same headers and footers, it i...
  • variable.caching
    ...lue of Smarty::CACHING_LIFETIME_CURRENT or Smarty::CACHING_LIFETIME_SAVED enable...
    ...ells Smarty whether or not to cache the output of the templates to the $cache_di...
    ...rmance gains. You can also have multiple caches for the same template. A constan...
    ...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...
    ...n the template output will have // a simple protection against spambots ? See al...
    ...email"); $smarty- display("index.tpl'); // now any occurrence of an email addres...
    ...filter ?php // put this in your application function protect_email($tpl_output, ...
  • plugins.inserts
    ...----------- * File: insert.time.php * Type: time * Name: time * Purpose: Inserts...
    ...ts Insert plugins are used to implement functions that are invoked by {insert} t...
  • smarty.for.programmers
    ...e_dir $cache_id $cache_lifetime $cache_locking $cache_modified_check $caching $c...
    ...es $allow_php_templates $auto_literal $autoload_filters $cache_dir $cache_id $ca...
  • language.function.block
    ...xt {block} {block} is used to define a named area of template source for templat...
  • language.modifier.strip
    ...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...
  • what.is.smarty
    ...cilitates a manageable way to separate application logic and content from its pr...
    ...ly the template files that have changed. You can easily create your own custom f...
    ...s logic in the template is your own doing. Also, if you desire no logic in your ...
  • caching.groups
    ...aching(Smarty::CACHING_LIFETIME_CURRENT); // clear all caches with 'sports|baske...
    ...f cache groups like a directory hierarchy. For instance, a cache group of 'a|b|c...
    ...e $cache_id value. You can have as many sub-groups as you like. You can think of...
    ...structure like themes/blue/index.tpl and you want to be able to clear all the ca...
    ...LY. You will need to group your templates under a single cache group heirarchy t...
  • language.variables
    ...ditional expressions, etc. To print a variable, simply enclose it in the delimit...
    ...P Associative arrays Array indexes Objects Variable scopes Variables loaded from...
  • advanced.features.postfilters
    ...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...
    ...ers are PHP functions that your templates are ran through after they are compile...
  • language.modifier.escape
    ...Next escape escape is used to encode or escape a variable to html , url , single...
  • api.fetch
    ...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 ...
    ...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,...
    ...ist if(!$smarty- isCached('index.tpl')) { // dummy up some data $address = '245 ...
  • language.function.assign
    ...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...
    ...ter handled in PHP. Use at your own discretion. Note See also the short-form met...
  • language.function.literal
    ...tags allow a block of data to be taken literally. This is typically used around ...
    ...ded by whitespace. Be sure your javascript and CSS curly braces are surrounded b...
  • language.function.debug
    ...e this gets executed at runtime, this is only able to show the assigned variable...
    ...g} dumps the debug console to the page. This works regardless of the debug setti...
    ...e also the variables which have been locally assigned within the template it doe...
  • installing.smarty.extended
    ...hing = Smarty::CACHING_LIFETIME_CURRENT; $this- assign('app_name', 'Guest Book')...
    ...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.Â...
    ...d the class and initialize your Smarty environment. So instead of repeatedly set...
  • variable.force.compile
    ... will be regenerated every time. Prev   Up   Next $force_cache  Home Â...
    ...compile This forces Smarty to (re)compile templates on every invocation. This se...
  • tips.componentized.templates
    ...y, programming templates into your applications goes as follows: First, you accu...
    ...So lets say for example we have a stock ticker on our template. We would collect...
    ...sign'], $ticker_info); } ? index.tpl {load_ticker symbol='SMARTY' assign='ticker...
    ...programming templates into your applications goes as follows: First, you accumul...
  • api.register.resource
    ...source_handler ); Use this to dynamically register a Resource plugin with Smarty...
    ...aged as callback functions have been deprecated as of Smarty 3.1. Example 14....
    ...marty- display('c:/path/to/index.tpl'); Note Prior to Smarty 3.1 registerResourc...
  • language.function.fetch
    ...v   Chapter 8. Custom Functions   Next {fetch} {fetch} is used to re...
    ...nclude a trailing slash on your web page fetches where necessary. If the file na...
  • api.get.registered.object
    ...€” returns a reference to a registered object Description array  getRegis...
  • variable.default.config.handler.func
    ...fied config's modification time * @param Smarty $smarty Smarty instance * @retur...
    ...s file: resource is unable to load a requested file * * @param string $type reso...
    ...f $content and $modified * have been filled, boolean false if no default config ...
  • api.clear.compiled.tpl
    ... Â Â Â  int  exp_time ); This clears the compiled version of the speci...
    ... clear entire compile directory $smarty- clearCompiledTemplate(); ? See also cle...
    ...ty- clearCompiledTemplate('index.tpl'); // clear entire compile directory $smart...
  • plugins.functions
    ...uestion: Will we ever have time travel? Answer: {eightball}. Example 18.2.Â...
    ...  All attributes passed to template functions from the template are contained...
    ...as: Question: Will we ever have time travel? Answer: {eightball}. Example 18....
    ...Ask again soon', 'Maybe in your reality'); $result = array_rand($answers); retur...
  • variable.default.template.handler.func
    ...ed template's modification time * @param Smarty $smarty Smarty instance * @retur...
    ...s file: resource is unable to load a requested file * * @param string $type reso...
    ...f $content and $modified * have been filled, boolean false if no default templat...
  • language.function.include
    ...l be assigned to cache_lifetime integer No n/a Enable caching of this subtemplat...
    ...t of {include} is assigned to, instead of being displayed. Similar to {assign} ....
    ...te. The {include} tag must have the file attribute which contains the template r...
  • language.function.include.php
    ... once if included multiple times assign string No n/a The name of the variable t...
    ...ty, use registered plugins to properly insulate presentation from the applicatio...
    ...to include a php script in your template. The path of the attribute file can be ...
  • language.function.section
    ...Sets the maximum number of times the section will loop. show boolean No TRUE Det...
    ...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...
  • resources
    ...ir Templates from any directory Windows Filepaths String Template Resources Stre...
    ...dir ?php $smarty- display('index.tpl'); $smarty- display('file:index.tpl'); // s...
  • variable.compile.check
    ...ate has changed (different timestamp) since the last time it was compiled. If it...
    ... application, Smarty tests to see if the current template has changed (different...
  • api.clear.all.cache
    ...rAllCache ( int  expire_time ); As an optional parameter, you can supply a mi...
  • api.create.data
    ...parameter. It is an uplink to the main Smarty object, a another user-created dat...
    ...ables. They can be used to have controll which variables are seen by which templ...
    ...= $smarty- createTemplate('index.tpl',$data); // display the template $tpl- disp...
  • variable.direct.access.security
    ...E . Note This is a compile time option. If you change the setting you must make ...
    ...bits direct browser access to compiled or cached template files. Direct access s...
  • variable.merge.compiled.includes
    ...; ? Note This is a compile time option. If you change the setting you must make ...
    ...g $merge_compiled_includes to TRUE Smarty will merge the compiled template code ...
    ...compiled_includes does not have to be enabled for the inline merge. ?php $smarty...
  • api.register.plugin
    ...ms["format"]; } return strftime($format,time()); } ? And in the template {date_n...
    ... $object being a reference to an object and $method being a string containing th...
    ...ions or methods defined in your script as plugin. It uses the following paramete...
  • api.clear.cache
    ... Â Â  int  expire_time ); If you have multiple caches for a template, y...
    ...r. You can group templates together so they can be removed as a group, see the c...
    ...  expire_time ); If you have multiple caches for a template, you can clear a ...
    ...plate $smarty- clearCache('index.tpl'); // clear the cache for a particular cach...
  • advanced.features.prefilters
    ...eprocessing your templates to remove unwanted comments, keeping an eye on what p...
    ...ments'); $smarty- display('index.tpl'); ? See also registerFilter() , postfilter...
    ...ers are PHP functions that your templates are ran through before they are compil...