W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
registerFilter() — 注冊(cè)過(guò)濾器
void registerFilter(string type,
mixed callback);
注冊(cè)過(guò)濾器。 參數(shù)如下:
type
defines the type of the filter. Valid values are "pre", "post", "output" and "variable".
callback
defines the PHP callback. it can be either:
A string containing the function name
An array of the form array(&$object, $method)
with &$object
being a reference to an object and $method
being a string containing the method-name
An array of the form array($class, $method)
with $class
being the class name and $method
being a method of the class.
If the chosen function
callback is of the form array(&$object, $method)
, only one instance of the same class and with the same$method
can be registered. The latest registered function
callback will be used in such a scenario.
prefilter前置過(guò)濾器,在模板編譯之前執(zhí)行的過(guò)濾器。 詳情參見(jiàn)前置過(guò)濾器。
postfilter后置過(guò)濾器,在模板編譯成PHP后執(zhí)行的過(guò)濾器。 詳情參見(jiàn)后置過(guò)濾器。
outputfilter輸出過(guò)濾器,在模板將要displayed前執(zhí)行的過(guò)濾器。 詳情參見(jiàn)輸出過(guò)濾器。
參見(jiàn) unregisterFilter()
, loadFilter()
, $autoload_filters
, 前置過(guò)濾器 后置過(guò)濾器輸出過(guò)濾器。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: