你如何在PHP中创建一个REST API? [英] How do you create a REST API in PHP?

查看:115
本文介绍了你如何在PHP中创建一个REST API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在开发的游戏网站,并计划增加一个API,让开发人员创建该网站的游戏。唯一的问题是你如何创建一个API更具体的一个REST API在PHP或任何其他语言,可以开发的API?

I've been developing gaming site and planning to add an API to let developers create games for the site. The only problem is how do you create an API more specifically a REST API in PHP or any other language that could develop APIs?

不好意思,刚才在API开发新的。

Sorry, just new in API Development.

任何帮助是AP preciated。

Any help is appreciated.

推荐答案

据当你理解了基本面的pretty容易。基本上你想要映射到修改数据,无论这些数据在数据库,XML文件,CSV文件,文本文件,取决于你的车型。

It's pretty easy when you understand the fundamentals. Basically you want controllers mapped to actions that modify data, whether that data's in a database, XML file, CSV file, text file depends on your models.

我创建了一个简单的API框架入门,你可以看看,并开始使用:<一href=\"https://github.com/martinbean/api-framework\">https://github.com/martinbean/api-framework

I created a simple API framework starter that you can take a look at and get started with: https://github.com/martinbean/api-framework

这篇关于你如何在PHP中创建一个REST API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆