3

Is Nette PHP framework is suitable for creation of RESTful API in PHP (for client JavaScript application), I cannot find a proper documentation apart IAuthenticator

  • Does Nette offer support RESTful? If no, does exist some stable "extensions"?
  • Does Nette offer support for token authentication? I notice cookies is the default using SimpleAuthetication.
GibboK
  • 71,848
  • 143
  • 435
  • 658

2 Answers2

5

I have used drahak/Restful long time ago. Last commit was 2 months ago so you should not have any problems. It provides you with more advanced router, OAuth2 and another tools to help you with building your API.

$router[] = new CrudRoute('api/v1/<presenter>/<id>/[<relation>[/<relationId>]]', 'Articles');

Also there was workshop on #posobota. Sources from API workshop can be found in fprochazka/workshop-rest-api-sandbox repository on GitHub.

Let me know if it works fine for you!

Northys
  • 1,305
  • 3
  • 16
  • 32
3

I am currently using Nette-RestRoute. Taken from description it "Automatically maps REST actions to Presenters and actions in the defined module." Usage is pretty straightforward so I would recommend it.

Teo.sk
  • 2,619
  • 5
  • 25
  • 30
  • drahak/Restful offers you more options, but for simple apis I would also suffest Nette-RestRoute. I used it right now for internal communication between apps and it works just fine :) – Northys Jun 07 '16 at 11:34