快捷搜索:

Smarty的应用

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 as Zend Accelerator (http://www.zend.com) or PHP Accelerator (http://www.php-accelerator.co.uk).

Smarty的特征之一是"模板编译"。意思是Smarty读取模板文件然后用他们创建php脚本。这些脚本创建今后将被履行。是以并没有花费模板文件的语法解析,同时每个模板可以享受到诸如Zend加速器(http://www.zend.com) 或者PHP加速器(http://www.php-accelerator.co.uk)。这样的php编译器高速缓存办理规划。

Some of Smarty's features:

Smaty的一些特征:

It is extremely fast.

异常异常的快!

It is efficient since the PHP parser does the dirty work.

用php阐发器干这个苦差事是有效的

No template parsing overhead, only compiles once.

不必要多余的模板语法解析,仅仅是编译一次

It is smart about recompiling only the template files that have changed.

仅对改动过的模板文件进行从新编译

You can make custom functions and custom variable modifiers, so the template language is extremely extensible.

可以编辑'自定义函数'和自定义'变量',是以这种模板说话完全可以扩展

Configurable template delimiter tag syntax, 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.

诸如 if/elseif/else/endif 语句可以被通报到php语法解析器,以是 {if ...} 表达式是简单的或者是复合的,随你爱好啦

Unlimited nesting of sections, ifs, etc. allowed.

假如容许的话,section之间可以无限嵌套

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.

引擎是可以定制的.可以内嵌php代码到你的模板文件中,虽然这可能并不必要(不保举)

Built-in caching support

内建缓存支持

Arbitrary template sources

自力模板文件

Custom cache handling functions

可自定义缓存处置惩罚函数

Plugin architecture

插件体系布局

您可能还会对下面的文章感兴趣: