承接 ntb/silverstripe-rest-api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ntb/silverstripe-rest-api

最新稳定版本:1.1.0

Composer 安装命令:

composer require ntb/silverstripe-rest-api

包简介

REST api module for Silverstripe

README 文档

README

Build Status Latest Stable Version License Scrutinizer Code Quality Total Downloads

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

Routes

For the definition of your routes, use the Silverstripe config system. You can add nested routes before the base route of that endpoint. In this example we have v/1/sessions, v/1/users/<ID> and v/1/users/<ID>/friends.

Director:
  rules:
    'v/1/users/$ID!/friends/$FriendID': 'FriendshipController'
    'v/1/users/$ID': 'UserController'
    'v/1/sessions/$ID': 'Ntb\RestAPI\SessionController'

GET Parameters

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

You can specify the access token with access_token. This can be used for accessing restricted resources with specific privileges.

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.

More Information

You can find more information in the wiki.

统计信息

  • 总下载量: 3.61k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 4
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-08-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固