用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1965|回复: 1
收起左侧

[讨论/交流] CI控制器里面不能使用魔术方法__call吗?

[复制链接]
发表于 2014-10-9 11:32:34 | 显示全部楼层 |阅读模式
<?php

class Test_call extends MY_Controller {


    public function __construct(){


        parent::__construct();
        }
    public function t(){
        echo 't';
    }

    // ---------------------------------魔术方法------------------------------------------------

    public static function __callStatic($method,$arg){
        echo '你想调用我不存在的方法',$method,'方法<br/>';
        echo '还传了一个参数<br/>';
        echo print_r($arg),'<br/>';
    }

    public function __call($method,$arg){
        echo '你想调用我不存在的方法1111',$method,'方法<br/>';
        echo '还传了一个参数<br/>';
        echo print_r($arg),'<br/>';
    }

}
?>

访问无存在的方法时还是404的错误输出,
                404 Page Not Found                The page you requested was not found.




 楼主| 发表于 2014-10-10 09:06:00 | 显示全部楼层
求高手解答~~~~

本版积分规则