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

[已解决] 关于框架加载其他类库的问题

[复制链接]
发表于 2012-9-25 10:40:24 | 显示全部楼层 |阅读模式
本帖最后由 Luffy。龙 于 2012-9-25 11:55 编辑
PHP复制代码

  • <?php
    [*]include ("php/phprpc_client.php");
    [*]$client = new PHPRPC_Client('http://127.0.0.1/app/rpcserver');
    [*]echo $client->HelloWorld();
    [*]?>
复制代码


以上是原类库加载方式。

PHP复制代码
 
                $url = 'http://127.0.0.1/app/rpcserver';                $this->load->library('phprpc/phprpc_client',$url);
//                 include APPPATH.'libraries/phprpc/phprpc_client.php';
//                 $client = new PHPRPC_Client($url);
                echo $this->phprpc_client->getString();
 
复制代码

这是我现在修改后的。

不过PHPRPC_Client这个类里面并没有构造函数,我该如何传值?


PHP复制代码
class PHPRPC_Client extends _PHPRPC_Client {        function __call($function, $arguments) {
            return $this->invoke($function, $arguments);
        }
    }
复制代码

这是类库文件中的一个类。


 楼主| 发表于 2012-9-25 11:55:07 | 显示全部楼层
解决了
发表于 2012-9-28 22:45:52 CI中国手机版 | 显示全部楼层
其实应该把required和load的概念分开来自: Android客户端

本版积分规则