Do I need a framework to build a REST API in PHP?

后端 未结 8 909
情歌与酒
情歌与酒 2020-12-23 11:27

I am fairly new to PHP (about 8 months). I am building a web app, which is almost ready for beta. I am only now starting to think about what I would need to do to make a mob

8条回答
  •  执念已碎
    2020-12-23 11:58

    SHORT ANSWER No, you don't need a framework to achieve your goal.

    BUT it will be really easier if you use a framework to manage your API. I suggest you to go for a lightweight framework and maybe you can convert easily your webapp to the framework too, having one "app" to return two different "things" (web stuff & API).

    Take a look at Laravel, Laravel 4 based REST API or a list of popular php rest api frameworks that can be used to build one.

提交回复
热议问题