Reference
C
Class

ApiPlatform\Symfony\EventListener\AddFormatListener

Chooses the format to use according to the Accept header and supported formats.

class ApiPlatform\Symfony\EventListener\AddFormatListener
{
    public __construct(Negotiation\Negotiator $negotiator, null|ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, array $formats)
    public onKernelRequest(Symfony\Component\HttpKernel\Event\RequestEvent $event): null
}
class ApiPlatform\Symfony\EventListener\AddFormatListener
{
    public __construct(Negotiation\Negotiator $negotiator, null|ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, array $formats)
    public onKernelRequest(Symfony\Component\HttpKernel\Event\RequestEvent $event): null
}

Methods

__construct

public __construct(Negotiation\Negotiator $negotiator, null|ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, array $formats)
public __construct(Negotiation\Negotiator $negotiator, null|ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, array $formats)

Parameters

negotiatorNegotiation\Negotiator
resourceMetadataCollectionFactoryApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface
formatsarray

onKernelRequest

Sets the applicable format to the HttpFoundation Request.

public onKernelRequest(Symfony\Component\HttpKernel\Event\RequestEvent $event): null
public onKernelRequest(Symfony\Component\HttpKernel\Event\RequestEvent $event): null

Parameters

eventSymfony\Component\HttpKernel\Event\RequestEvent

Returns

null

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop