3. Instructions for use
I am too lazy to compare the usage of five {pages} in "plugins.html" and check the displayed results to understand what it is.
4. plug-ins
"Smarty Manual Chapter 16th. extension of Smarty with plug-ins" applications. You can use plugins to expand Smarty for Chinese character interceptions. the built-in Smarty interceptions do not support Chinese characters.
__________________
II. Smarty automatically generates static pages
If your file extension is ". html "~~~~~ Hey, isn't this a static page? -_-!
Return basename ($ _ cache_file );
} // End func
} // End class
$ Smarty = new template;
$ File_name = $ Smarty-> name ('plugins.html ', 'cache _ name'); # name of the html file (excluding the path)
$ Smarty-> cache_lifetime =-1; # static files never expire
$ Smarty-> fetch ('plugins.html ', 'cache _ name'); # generate a static html file
This is translation from the village. In fact, the application of Smarty is far more than that.
One of the unique aspects about Smarty is the template compling. this means Smarty reads the template files and creates PHP scripts from them. once they are created, they are executed from then on. therefore there is no costly template file parsing for each request, and each template can take full advantage of PHP compiler cache solutions such
ZendAccelerator (http://www.zend.com) or PHP Accelerator (http://www.php-accelerator.co.uk ).
One of the features of Smarty is "template compilation ". It means that Smarty reads the template file and uses it to create a php script. These scripts will be executed after they are created. As a result, no syntax parsing is spent on the template file, and each template can enjoy something like a Zend accelerator (http://www.zend.com) or a PHP accelerator (http://www.php-accelerator.co.uk ). This php compiler high-speed cache solution.
Some of Smarty's features:
Some features of Smaty:
It is extremely fast.
Very fast!
It is efficient since the PHP parser does the dirty work.
Using a php analyzer to perform this task is effective.
No template parsing overhead, only compiles once.
No extra template syntax parsing is required, and only one compilation is required.
It is smart about recompiling only the template files that have changed.
Only recompile the modified template file
You can make custom functions and custom variable modifiers, so the template language is extremely extensible.
You can edit 'udf 'and 'variable'. Therefore, this template language can be fully expanded.
Retriable template delimiter tag syntax, so you can use {},{{}}, , Etc.
You can set template delimiters by yourself, so you can use {},{{}}, , Etc.
The if/elseif/else/endif constructs are passed to the PHP parser, so the {if...} expression syntax can be as simple or as complex as you like.
For example, if/elseif/else/endif statements can be passed to the php syntax parser, so the {if...} expression is simple or composite, as you like.
Unlimited nesting of sections, ifs, etc. allowed.
If allowed, sections can be nested infinitely.
It is possible to embed PHP code right in your template files, although this may not be needed (nor recommended) since the engine is so customizable.
The engine can be customized. php code can be embedded into your template file, although this may not be required (not recommended)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.