arguv/crud-api-bundle

Symfony的CRUD API包

安装: 1

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

dev-master 2020-06-28 13:09 UTC

This package is auto-updated.

Last update: 2024-09-10 15:46:59 UTC


README

Composer

composer require arguv/crud-api-bundle:dev-master

AppKernel

将包包含在您的AppKernel中

public function registerBundles()
{
    $bundles = [
        ...
        new Arguv\CrudApiBundle\CrudApiBundle(),

路由

arguv_crud_api:
    resource: '@CrudApiBundle/Controller/'
    type:     annotation

Doctrine

php bin/console doctrine:schema:update --force

CRUD

GET   /arguv/list
GET   /arguv/list/{id}
POST  /arguv/create
POST  /arguv/update/{id}
POST  /arguv/delete/{id}

JSON

[
   {
      "name": "Smith",
      "description": "Willard Carroll Smith Jr. is an American actor and rapper."
   }
]