smarty 2.0版本引入了被广泛应用于自定义Smarty功能的插件机制,它包括如下类型:
    functions 函数插件
    modifiers 修饰插件
    block functions 区块函数插件
    compiler functions 编译函数插件
    prefilters 预滤器插件
    postfilters 补滤器插件
    outputfilters 输出过滤插件
    resources 资源插件
    inserts 嵌入插件

为了与旧有方式保持向后兼容,除资源插件外,保留了通过register_* API方式装载函数的处理方法。如果你不是使用API方式而是使用直接修改类变量 $custom_funcs, $custom_mods 等的方法,那么你就需要修改你的程序了。或者使用API的方法,或者将你的自定义功能转换成插件.



type . name .php


  • function
  • modifier
  • block
  • compiler
  • prefilter
  • postfilter
  • outputfilter
  • resource
  • insert



Smarty可自动从文件系统装载插件,或者运行时通过register_* API函数装载。可以通过unregister_* API函数卸载已经装载的插件,只在运行时装载的插件的函数名称不需要遵守命名约定。


require_once $smarty->_get_plugin_filepath('function', 'html_options');


  1. There are certainly numerous particulars like that to take into consideration. That is a great point to deliver up. I supply the ideas above as basic inspiration however clearly there are questions like the one you convey up where crucial factor will be working in honest good faith. I don?t know if finest practices have emerged round things like that, however I’m sure that your job is clearly recognized as a good game. Each boys and girls really feel the affect of just a moment’s pleasure, for the rest of their lives.

  2. Valuable information and excellent design you got here! I would like to thank you for sharing your thoughts and time into the stuff you post!! Thumbs up! I just hope to have understood this the way it was meant. My best regards, Tamiko.


电子邮件地址不会被公开。 必填项已用*标注

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>