api接口简短实力

2021-04-26 09:28

阅读:531

标签: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


评论


亲,登录后才可以留言!