haskel/map-serializer-bundle

此包集将 haskel/map-serializer 库集成到 Symfony 中

安装: 19

依赖项: 0

建议者: 0

安全: 0

星星: 0

关注者: 1

分支: 0

开放问题: 0

类型:symfony-bundle

v0.1 2020-10-17 10:23 UTC

This package is auto-updated.

Last update: 2024-09-17 18:46:34 UTC


README

Symfony 的 map-serialiser 组件包

安装

composer require haskel/map-serializer-bundle

使用

将包添加到 config/bundles.php

Haskel\MapSerializerBundle\MapSerializerBundle::class => ['all' => true]

将 yaml 架构添加到 config/map_serializer 示例 config/map_serializer/User.yaml

App\Entity\User:
  default:
    id: 'int'
    username: 'string'
    isActive: 'boolean'
    group: 'default'
    role: 'string'
    name: 'string'
    email: 'string'
    
  simple:
    id: 'int'
    name: 'string'
    
  public:
    username: 'string'
    email: 'string'
    name: 'string'

好的,你的响应将由 \Haskel\MapSerializerBundle\EventListener\ResponseListener 处理