企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><th colspan="3" align="center">Smarty - the compiling PHP template engine</th></tr><tr><td width="25%" align="left" valign="bottom"><a href="plugins.how.plugins.work.html" accesskey="P">Prev</a></td><td width="50%" align="center" valign="bottom">Chapter 16. Extending Smarty With Plugins</td><td width="25%" align="right" valign="bottom"><a href="plugins.writing.html" accesskey="N">Next</a></td></tr></table> # 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, see php variables [http://php.net/language.variables]. Some examples: function.html_select_date.php, resource.db.php, modifier.spacify.php *name*为合法标识符,仅包含字母、数字和下划线的,查看[php变量](http://php.net/language.variables)。 举例如下: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 above. An example modifier name foo would be function smarty_modifier_foo(). ***type***和*name*的含义同上。 举例,调节器(modifier)命名为foo,那么按规则函数为smarty_modifier_foo()。 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会输出对应的错误信息。 <table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="plugins.how.plugins.work.html" accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="plugins.writing.html" accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">How Plugins Work<br/> 插件如何工作</td><td width="34%" align="center" valign="top"><a href="plugins.html" accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Writing Plugins 编写插件</td></tr></table>