这里会显示出您选择的修订版和当前版本之间的差别。
— |
zblogphp:development:plugin:interfacestc:filter_plugin_category_call [2020/07/29 11:35] (当前版本) 唐朝 创建 |
||
---|---|---|---|
行 1: | 行 1: | ||
+ | 案例(在分类调用页面添加新的自定义函数) | ||
+ | |||
+ | <code php> | ||
+ | function ActivePlugin_tc_cs() { | ||
+ | Add_Filter_Plugin('Filter_Plugin_Category_Call', 'ytecn_category_call'); | ||
+ | } | ||
+ | |||
+ | function ytecn_category_call($ca,$method, $args){ | ||
+ | global $zbp; | ||
+ | if($method == 'abc'){ | ||
+ | $GLOBALS['hooks']['Filter_Plugin_Post_Call']['ytecn_category_call']=PLUGIN_EXITSIGNAL_RETURN; | ||
+ | return "这里输出abc"; | ||
+ | } | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | 然后在分类页调用 | ||
+ | <code php> | ||
+ | {$cate->abc()} | ||
+ | </code> | ||
+ | 就会输出“这里输出abc” | ||
+ | |||