Get Smarty

Donate

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

Advertisement

命名规则

插件文件和函数必须遵循特定的命名规则以便Smarty识别。

插件文件命名规则:

type.name.php

  • 其中type是以下任一种插件类型:

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

  • name必须是合法的函数名(仅包括字母、数字和下划线),参考 php variables

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

PHP文件内的插件函数命名规则:

smarty_type, _name

  • typename规则同上。

  • 例如一个修饰器名称为 foo,函数名就是 function smarty_modifier_foo()

当找不到插件文件,或者文件/插件函数的命名不恰当的时候,Smarty将提示错误信息。

Comments
No comments for this page.

Advertisement

Sponsors [info]

Sponsors