美文网首页
CI框架下的rest使用

CI框架下的rest使用

作者: _伽蓝寺听雨声 | 来源:发表于2016-06-16 17:59 被阅读184次

1.配置本地hosts

2.配置虚拟机apache vhosts

3.配置虚拟机hosts

4.加载REST_Client.php和Curl.php

5.constans.php  => 

       $autoload['libraries']=array('uri','database','REST_Client');

       define('BASE_URL','http://home.loc');

      define('BLL_API_URL','http://newsbll.loc/index.php/');//业务逻辑层接口主机

6.   config.php  =>  $config['base_url'] = BASE_URL;

7.bll写方法并返回值

8.view层请求bll对应方法

$this->rest_client->initialize(array("server"=>BLL_API_URL));

$res = $this->rest_client->get();

相关文章

网友评论

      本文标题:CI框架下的rest使用

      本文链接:https://www.haomeiwen.com/subject/scxfdttx.html