Guides
Tutorials
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
}
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)
negotiator | Negotiation\Negotiator | |
resourceMetadataCollectionFactory | ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface | |
formats | array |
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
event | Symfony\Component\HttpKernel\Event\RequestEvent |
null