Skip to content

edemal/silverstripe-rest-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REST module for Silverstripe

This module models the REST api in a simple fashion.

All routes for the different resources should resolved by a controller which extends the BaseRestController.

After that, you can add your routes into your YAML config file.

Features

  • Queries
  • Field list
  • Different serialisation formats
  • Pagination
  • Presenters

Usage

Every endpoint has its own controller. The controller should extend BaseRestController.

If you visit your api through a browser, the controller will render it as html as long as you not specified an accept GET param, eg. ?accept=json.

Testing

For functional tests, you can extend the RestTest class and use it to test your application. We recommend to use fixtures for testing like it is explained in the Silverstripe documentation.

About

REST api module for Silverstripe

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.4%
  • Scheme 0.6%