码迷,mamicode.com
首页 > Windows程序 > 详细

api接口简短实力

时间:2017-11-25 11:09:46      阅读:330      评论:0      收藏:0      [点我收藏+]

标签:amp   front   UI   com   art   cti   array   end   frontend   

无参数传递

public function actionJiekou(){
$url = ‘http://wap.guoshihui.com/_static/wap/video/startVideo.mp4‘;
$data = array(
‘status‘ => ‘200‘,
‘message‘ => ‘数据获取成功‘,
‘url‘ => $url,
);
return json_encode($data);
}

 

http://yii.com/frontend/web/index.php?r=country/jiekou

{"status":"200","message":"\u6570\u636e\u83b7\u53d6\u6210\u529f","url":"http:\/\/wap.guoshihui.com\/_static\/wap\/video\/startVideo.mp4"}

 有参数传递

public function actionJiekou(){
$id = $_GET[‘id‘];
$url = ‘http://wap.guoshihui.com/_static/wap/video/startVideo.mp4‘;
$data = array(
‘id‘ => $id,
‘status‘ => ‘200‘,
‘message‘ => ‘数据获取成功‘,
‘url‘ => $url,
);
return json_encode($data);
}

http://yii.com/frontend/web/index.php?r=country/jiekou&id=88897

{"id":"88897","status":"200","message":"\u6570\u636e\u83b7\u53d6\u6210\u529f","url":"http:\/\/wap.guoshihui.com\/_static\/wap\/video\/startVideo.mp4"}

 

api接口简短实力

标签:amp   front   UI   com   art   cti   array   end   frontend   

原文地址:http://www.cnblogs.com/yszr/p/7893001.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!