1 Star 0 Fork 5

兮牛科技/PhalApi Net

forked from dogstar/PhalApi Net 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
tutorial.html 8.84 KB
一键复制 编辑 原始数据 按行查看 历史
dogstar 提交于 2019-10-21 15:29 . up
<!DOCTYPE html>
<html lang="cn" style="">
<head>
<title>快速开始 - PhalApi(π框架) - 接口,从简单开始!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="http://webtools.qiniudn.com/dog_catch.png" type="image/x-icon" />
<meta name="description" content="PhalApi是一个PHP轻量级开源接口框架,致力于快速开发接口服务。支持HTTP/SOAP/RPC等协议,可用于搭建接口/微服务/RESTful接口/Web Services。我们不断更新,保持生气;为接口负责,为开源负责!并承诺永久免费!">
<meta name="keywords" content="PhalApi,phalapi,phalapi接口开发,后台接口开发,后台接口开发框架,接口开发,接口框架,开源接口框架,PHP后台接口开发,PHP接口开发,PHP接口框架,PHP后台接口框架,phalapi官网,PHP接口框架">
<meta name="author" content="dogstar">
<link rel="stylesheet" type="text/css" href="./css/screen.css?20150211" />
</head>
<body>
<a href="https://github.com/phalapi/phalapi/tree/release">
<img alt="Fork me on GitHub" data-canonical-src="http://cdn71.phalapi.net/images/2/2d/9e69c0ebaff22a24e241a0244532e.png" src="http://cdn71.phalapi.net/images/2/2d/9e69c0ebaff22a24e241a0244532e.png" style="position: absolute; top: 0; right: 0; border: 0;">
</a>
<!-- 最顶部的语言(S) -->
<div class="grid-wrapper navbar desktop-only">
<div class="grid">
<div class="grid__cell">
<ul id="language-switchers" class="navbar__links navbar--left">
<li class="menu-item"><a title="PhalApi官方网站中文版" href="./" class="menu-item__link">中文版</a></li>
<li class="menu-item"><a title="English version of PhalApi website" href="/wikis/en/" class="menu-item__link">English</a></li>
</ul>
<ul id="util-menu" class="navbar__links navbar--right navbar--vertical-separator">
<li class="menu-item"><a href="https://github.com/phalapi/phalapi" class="menu-item__link contact-us-spec" target="_blank">Star一下,为高考加油!!</a></li>
</ul>
</div>
</div>
</div>
<!-- 最顶部的语言(E) -->
<!-- 顶部导航菜单(S) -->
<div class="grid-wrapper desktop-only">
<div class="grid">
<div class="grid__cell">
<div class="header__header-wrapper">
<a title="PhalApi" href="http://www.phalapi.net" class="header__logo"><img src="http://webtools.qiniudn.com/master-LOGO-20150410_33.jpg" id="tw-logo" alt="PhalApi"></a>
<ul id="main-menu" class="header__menu">
<li class="menu-item"><a href="http://talk.phalapi.net/" class="menu-item__link insights-spec" target="_blank">社区</a></li>
<li class="menu-item"><a href="/download.html" class="menu-item__link insights-spec" target="_blank">下载</a></li>
<li class="menu-item"><a href="/wikis/" class="menu-item__link events-spec" target="_blank">文档</a></li>
<li class="menu-item"><a href="http://www.ituring.com.cn/book/2405" class="menu-item__link events-spec" target="_blank">书籍</a></li>
<li class="menu-item"><a href="/wikis/%5b8.1%5d-PhalApi%e8%a7%86%e9%a2%91%e6%95%99%e7%a8%8b.html" class="menu-item__link events-spec" target="_blank">视频教程</a></li>
<li class="menu-item"><a href="/docs/" class="menu-item__link events-spec" target="_blank">类参考手册</a></li>
<li class="menu-item"><a href="http://demo.phalapi.net/" class="menu-item__link products-spec" target="_blank">在线体验</a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- 顶部导航菜单(E) -->
<!-- 焦点部分(S) -->
<div class="grid-wrapper">
<div class="grid grid--center">
<div class="grid__cell grid__cell--centered">
<h1 class="homepage--title">快速开始</h1>
</div>
<div class="grid__cell unit-3-4--lap grid__cell--centered">
<p class="homepage--subtitle">简明接口开发,让你在最短的时间内体验PhalApi的乐趣。</p>
</div>
</div>
</div>
<!-- 焦点部分(E) -->
<!-- 快速开始(S) -->
<div class="grid-wrapper">
<div class="grid">
<div class="grid__cell">
<h3>1、编写一个接口</h3>
<p>以下代码需要放置到./Demo/Api/Welcome.php这个对应的接口类文件中:</p>
<pre><code>&lt;?php
class Api_Welcome extends PhalApi_Api {
public function say() {
$rs = array();
$rs['title'] = 'Hello World!';
return $rs;
}
}</code></pre>
<h3>2、访问接口</h3>
<p>接口访问的格式为:接口域名 + 入口路径 + ?service=XXX.XXX,此示例中对应的链接为:</p>
<pre><code>http://dev.phalapi.com/demo/?service=Welcome.Say</code></pre>
<p>注意!如果没有配置nginx,千万别访问./Demo/下的源代码,而是应该访问公共入口./Public/demo/,请使用以下访问链接:</p>
<pre><code>http://localhost/Public/demo/?service=Welcome.Say</code></pre>
<h3>3、接口返回</h3>
<p>结果默认以JSON格式返回,即:</p>
<pre><code>{"ret":200,"data":{"title":"Hello World!"},"msg":""}</code></pre>
<p>可视化效果为:</p>
<pre><code>{
"ret": 200,
"data": {
"title": "Hello World!"
},
"msg": ""
}</code></pre>
<h3>4、运行截图</h3>
<img src="http://webtools.qiniudn.com/20150111.jpg" />
<h3>5、恭喜!你已精通PhalApi接口开发了!</h3>
<p>更多内容,请查看 <a href="/wikis/" >官网文档</a></p>
</div>
</div>
</div>
<!-- 快速开始(E) -->
<!-- 广告位 -->
<div class="grid-wrapper desktop-only">
<p align="center">
<a href="http://cdn7.phalapi.net/%E6%88%91%E7%9A%84%E5%90%8D%E5%AD%97%E5%8F%AB%EF%BC%9A%CF%80%E6%A1%86%E6%9E%B6%20-%20PhalApi%202016%E5%B9%B4%E5%BA%A6%E5%BC%80%E6%BA%90%E6%80%BB%E7%BB%93%20-%20%E5%AE%98%E6%96%B9%E5%87%BA%E5%93%81.pdf" target="blank"><img width="950" height="100" src="http://cdn7.phalapi.net/ad_20170104.png"></a>
<a href="http://talk.phalapi.net" target="blank"><img width="950" height="100" src="http://cdn71.phalapi.net/qa_ad_20150615.jpg"></a>
</p>
</div>
<!-- footer(S) -->
<div class="grid-wrapper footer">
<div id="footer" class="grid">
<div class="grid__cell unit-1-2--lap">
<h3>PhalApi (π框架)</h3>
<p>
<font size="3px">一个轻量级PHP开源接口框架,专注于接口服务开发,支持HTTP/SOAP/RPC协议,拥有自动生成的在线文档、多种开发语言的客户端SDK包以及可重用的扩展类库,可用于快速搭建微服务、RESTful接口或Web Services。</font>
</p>
</div>
<div class="grid__cell unit-1-2--lap">
<h3>与我们互动</h3>
<!-- http://www.easyicon.net/iconsearch/iconset:nviconslib-icons/1/ -->
<p>
<a target="_blank" class="footer__icon" href="https://github.com/phalapi/phalapi"><img alt="GitHub" id="GitHube" src="http://cdn7.phalapi.net/GitHub.png"></a>
<a target="_blank" class="footer__icon" href="http://weibo.com/p/100808d236e99beb645bfb56ed1c37dde9b8bd?k=phalapi%E5%BC%80%E6%BA%90%E6%A1%86%E6%9E%B6&from=501&_from_=huati_topic"><img alt="微博互动" id="GitHube" src="http://cdn7.phalapi.net/sina_weibo.png"></a>
<a target="_blank" class="footer__icon" href="http://cdn71.phalapi.net/images/1/b0/894fde762850cb11250253f7d5ede.png"><img alt="支付宝捐赠" id="QQ" src="http://cdn7.phalapi.net/Alibabai_Alipay_65.11528150134px_1188640_easyicon.net.png"></a>
<a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=f16292029e59975d4ccfccc70ed87aa5c5646df512e83b0e9e1270e8368be461"><img border="0" src="images/qq.png" alt="π框架 - PhalApi交流群②" title="π框架 - PhalApi交流群②"></a>
</p>
</div>
<div class="grid__cell">
<p>
<font size="2px">
友情链接: <a href="https://www.phalapi.net/" class="menu-item__link" target="_blank"><strong>PhalApi</strong></a>
| <a href="http://www.oschina.net/" class="menu-item__link" target="_blank">开源中国</a>
| <a href="https://www.itran.cc/" class="menu-item__link" target="_blank">艾翻译</a>
| <a href="http://www.phalconphp.com/en/" class="menu-item__link" target="_blank">Phalcon</a>
| <a href="https://phpunit.de/manual/3.7/zh_cn/automating-tests.html" class="menu-item__link" target="_blank">PHPUnit</a>
| <a href="http://www.thoughtworks.com/cn/" class="menu-item__link" target="_blank">ThoughtWorks</a>
| <a href="mailto:chanzonghuang@gmail.com" class="menu-item__link" target="_blank">友链交换</a>
<br />
&copy;2015-2018 PhalApi All Rights Reserved. <a href="http://www.miitbeian.gov.cn" target="_blank" >粤ICP备15028808号</a>
</font>
<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1255326144'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s4.cnzz.com/z_stat.php%3Fid%3D1255326144%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));</script>
</p>
</div><!-- grid__cell -->
</div>
</div>
<!-- footer(E) -->
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/seenew/PhalApi-Net.git
git@gitee.com:seenew/PhalApi-Net.git
seenew
PhalApi-Net
PhalApi Net
master

搜索帮助