Get Smarty


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

Buy cheap glasses from and save up to 80%.

Where to buy prescription glasses? is your best choice!

Where to buy discount wedding dresses and cheap smart dresses free shipping -

Shop for 2018 World Cup Football Boots Online sale at

Browse best 2018 world cup soccer cleats and shoes from



通过你会通过修改Smarty 成员变量 来修改Smarty的设置。 此外,你还可以通过Smarty 函数 来注册插件、过滤器等等。 Smarty对象的修改将是全局的。

然而你也可以通过单独的模板对象来修改Smarty的成员变量或调用函数。 模板对象的修改将只会作用于当前模板和其包含的子模板。

Example 17.4. 创建模板对象并修改Smarty的设置

$tpl = $smarty->createTemplate('index.tpl');
$tpl->cache_lifetime = 600;


Example 17.5. 创建模板对象并注册插件

$tpl = $smarty->createTemplate('index.tpl');


No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Email: (not shown)
What is 14 plus 3? (Are you human?)