W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
registerFilter() — 注冊過濾器
void registerFilter(string type,
mixed callback);
注冊過濾器。 參數(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前置過濾器,在模板編譯之前執(zhí)行的過濾器。 詳情參見前置過濾器。
postfilter后置過濾器,在模板編譯成PHP后執(zhí)行的過濾器。 詳情參見后置過濾器。
outputfilter輸出過濾器,在模板將要displayed前執(zhí)行的過濾器。 詳情參見輸出過濾器。
參見 unregisterFilter()
, loadFilter()
, $autoload_filters
, 前置過濾器 后置過濾器輸出過濾器。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: