Naming Conventions 命名約定

Plugin files and functions must follow a very specific naming convention in order to be located by Smarty.

插件文件和函數必須遵循特定的命名約定以便Smarty識別。

The plugin files must be named as follows:

插件文件必須命名如下:

type.name.php

 

Where type is one of these plugin types:

 

其中type是如下插件中的一種:

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

 

And name should be a valid identifier (letters, numbers, and underscores only).

name爲僅包含字母、數字和下劃線的合法標誌符。

Some examples例如: function.html_select_date.php, resource.db.php, modifier.spacify.php.

The plugin functions inside the plugin files must be named as follows:

插件內的函數應遵循如下命名約定:

smarty_type_name()

 

The meanings of type and name are the same as before.

typename的意義如前。

Smarty will output appropriate error messages if the plugin file it needs is not found, or if the file or the plugin function are named improperly.

如果指定的插件文件不存在或命名不合規範,Smarty會輸出相應的錯誤信息。

 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章