承接 nedra/rest-bundle 相关项目开发

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

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

nedra/rest-bundle

Composer 安装命令:

composer require nedra/rest-bundle

包简介

Generates a REST api based on your entities

README 文档

README

Build Status

NedraRestBundle

NedraRestBundle creates automatically a REST API based on your models. Just give your models and use your auto-generated endpoints.

Get Started

Bundle works on Doctrine ORM based models. Bundle purpose is generate a REST Api in fastest and easy way.

Installation

Step 1: Update composer.json

composer require nedra/rest-bundle

Step 2: Register Classes to AppKernel

[...]
new FOS\RestBundle\FOSRestBundle(),
new JMS\SerializerBundle\JMSSerializerBundle($this),
new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
new Nedra\RestBundle\NedraRestBundle(),

Step 3: Update your config.yml for NedraRestBundle

nedra_rest:
    active: true # this is default value, you can disable the bundle with set to false
    entities:
        app.model:
            classes:
                model: AppBundle\Entity\Model

Note

app.model is a pattern example. You must define your models with application prefix like app

Check Routes

Run that command and debug your router

bin/console debug:router

You will see auto-generated routings for REST

app_model_index             GET         ANY      ANY    /models/                            
app_model_create            POST        ANY      ANY    /models/new                         
app_model_update            PUT|PATCH   ANY      ANY    /models/{id}                        
app_model_show              GET         ANY      ANY    /models/{id}                        
app_model_delete            DELETE      ANY      ANY    /models/{id} 

Configuration Reference

nedra_rest:
    entities:
        app.model:
            path: model # you can change /models/ to /cars/
            except: ['show']
            only: ['create', 'index']
            classes:
                model: AppBundle\Entity\Model
                form:  AppBundle\Form\ModelType

Note

You can use only one of them except or only

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固