<?php 
/* 
*/class plugin_sharetoweibo {function global_header(){return "Hello World";}function viewthread_postfooter(){
return "Hello World";
}}
?>上面是我的简单测试代码。
global_header()能正常输出,而viewthread_postfooter()输出为空!请问哪里出问题呢? 

解决方案 »

  1.   

    global_header是全局嵌入点函数,可以直接使用,而其他非全局函数,需要重新定义一个类来继承上面的基类,然后在新定义的这个子类里面使用该函数。
      

  2.   

    <?php class plugin_sharetoweibo {    function global_header(){        return "Hello World";    }
    }class plugin_sharetoweibo_hello extends class plugin_sharetoweibo{
        function viewthread_postfooter(){
            return "Hello World";
        }
    }?>
    这样试试看行不行~