Smarty - the compiling PHP template engine | ||
---|---|---|
Prev | Chapter 16. Extending Smarty With Plugins 利用插件扩展Smarty | Next |
Modifiers are little functions that are applied to a variable in the
template before it is displayed or used in some other context.
Modifiers can be chained together.
修正器是一些短小的函数,这些函数被应用于模版中的一个变量,然后变量再显示或用于其他的一些文档。我们可以把修正器链接起来。
The first parameter to the modifier plugin is the value on which
the modifier is supposed to operate. The rest of the parameters can be
optional, depending on what kind of operation is supposed to be
performed.
修正器插件的第一个参数是不可缺少的。剩余的参数是可选的,它们的有无取决于期望执行哪一种操作。
The modifier has to return the result of its processing.
修正器必须有返回值。
See also
register_modifier(),
unregister_modifier().
也可参考register_modifier(),
unregister_modifier().
Example 16-4. more complex modifier plugin更加复杂的修正器插件
|