关于框架加载其他类库的问题
本帖最后由 Luffy。龙 于 2012-9-25 11:55 编辑[*]<?php
[*]include ("php/phprpc_client.php");
[*]$client = new PHPRPC_Client('http://127.0.0.1/app/rpcserver');
[*]echo $client->HelloWorld();
[*]?>
以上是原类库加载方式。
$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这个类里面并没有构造函数,我该如何传值?
class PHPRPC_Client extends _PHPRPC_Client { function __call($function, $arguments) {
return $this->invoke($function, $arguments);
}
}
这是类库文件中的一个类。
http://codeigniter.org.cn/forums/data/attachment/album/201209/25/104355f1puqprf5irpcacz.jpg
:victory:解决了 其实应该把required和load的概念分开
页:
[1]