Get Smarty

Donate

Donate Bitcoin Bitcoin
Paypal

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 eyeglasses from Cheapglasses123.com and save up to 80%.

Buy prescription glasses from www.australiaglasses.com and save.

Cheap Glasses Now On Sale at GlassesPeople.com. Starts At $7.95.

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

Brautkleider auf Topwedding.de

Find free files to download on allwhatyouwant.net

Looking For Affordable Wedding Dresses 2015 at Best Prices On TDBridal.com

Shop high quality cheap prom dresses on Dresswe.co.uk

Buy New Arrival Cheap Prom Dresses 2015 at JDBRIDAL Prom Dress Store

Advertisement

Chapter 18. 以�件扩展Smarty

Smarty 2.0引入的�件架构,已��为了Smarty最常使用的自定义功能了。 �件包�了:

  • functions
  • modifiers
  • block functions
  • compiler functions
  • prefilters
  • postfilters
  • outputfilters
  • resources
  • inserts

除了资��件以外,为了�上兼容还是�留了通过register_* API�注册�件的方�。 如果你�是使用API方�而是使用直接修改$custom_funcs, $custom_mods等方�,那么你需�调整你的代�,改为通过API方�或 转��自定义�件。

�件如何工作

�件是按需载入的。当特定的修饰器,函数,资�等被调用的时候�件�会被载入。 而且,�使�一请求中有多个Smarty实例在�行,�个资�也�会被载入一次。

�置/�置过滤器和输出过滤器�微有些��。 虽然它们并没有在模�中使用,但是当模�执行的时候,它们必须通过API被注册或者被明确载入。 相�类型的过滤器执行的顺�会��它们注册或载入的先�顺�。

�件目录���以是一个路径的字符串或者是包�多个路径的数组。 安装�件的方法是直接把�件文件放置在这些目录下,Smarty会自动按需使用。

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

Advertisement