• 3
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

How do you create a REST API in PHP? [closed]

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.

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

  • 15
Reply Report
      • 1
    • @MartinBean I realise this comes a little later, but is your framework linked above simply a 'starter' for basing your own API on or does it independently handle everything like I've seen many other frameworks do?
    • @KristianMatthews It's literally a starter; you build your API on it how you wish. It doesn't assume anything about what your database setup or whatever is. You create your controllers and models; it handles the requests and responses, and is lightweight enough to be extended and built upon.

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions