2017 © Pedro Peláez
 

library serialize-response

Serializes a Controller Response

image

geosocio/serialize-response

Serializes a Controller Response

  • Monday, June 19, 2017
  • by davidbarratt
  • Repository
  • 1 Watchers
  • 0 Stars
  • 34 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Serialize Response

Serializes a Controller Response., (*1)

Example

This controller's response would get serialized into the same format of the request., (*2)

public function showAction(Post $post) {
    return $post;
}

Configuration

Define a service in your configuration like this:, (*3)

app.return_listener:
    class: GeoSocio\SerializeResponse\EventListener\KernelViewListener
    arguments:
        - '@serializer'
        - '@serializer'
        - '@security.token_storage'
        -
            - 'anonymous'
    tags:
        - { name: kernel.event_listener, event: kernel.view }

You can customize the Serialization Groups that are used by implementing GeoSocio\SerializeResponse\Serializer\UserGroupsInterface. Then getGroups will be executed on the currently authenticated user and the object that is being normalized will be passed as an argument., (*4)

The Versions

19/06 2017

dev-develop

dev-develop

Serializes a Controller Response

  Sources   Download

LGPL-3

The Requires

 

The Development Requires

19/06 2017
16/06 2017
16/06 2017
16/06 2017