?
Dieses Dokument verwendet PHP-Handbuch für chinesische Websites Freigeben
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.
修正器是一些短小的函數(shù),這些函數(shù)被應(yīng)用于模版中的一個(gè)變量,然后變量再顯示或用于其他的一些文檔。我們可以把修正器鏈接起來(lái)。
mixed smarty_modifier_
name
(mixed $value, [mixed $param1, ...])
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.
修正器插件的第一個(gè)參數(shù)是不可缺少的。剩余的參數(shù)是可選的,它們的有無(wú)取決于期望執(zhí)行哪一種操作。
The modifier has to return the result of its processing.
修正器必須有返回值。
See also
register_modifier(),
unregister_modifier().
也可參考register_modifier(),
unregister_modifier().
Example 16-3. simple modifier plugin簡(jiǎn)單修正器插件 This plugin basically aliases one of the built-in PHP functions. It
does not have any additional parameters.
|
Example 16-4. more complex modifier plugin更加復(fù)雜的修正器插件
|