Download the PHP package gisostallenberg/response-content-negotiation-bundle without Composer
On this page you can find all versions of the php package gisostallenberg/response-content-negotiation-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gisostallenberg/response-content-negotiation-bundle
More information about gisostallenberg/response-content-negotiation-bundle
Files in gisostallenberg/response-content-negotiation-bundle
Package response-content-negotiation-bundle
Short Description A bundle that allows creating various Response types from a controller, based on content negotiation
License MIT
Informations about the package response-content-negotiation-bundle
Response Content Negotiation Bundle
A bundle that allows creating various Response types from a controller, based on content negotiation
Installation
Requirements
HTML
To render HTML the bundle requires TwigBundle.
JSON & XML
To output JSON or XML the bundle requires FOS Rest Bundle and JMS Serializer Bundle or Symfony Serializer
Usage
HTML
This will render acme.html.twig
with the Twig context ['my-data-label' => 'my data']
.
If you want to render a specific template, you can add this as template
argument to the ResultData.
For example:
This will render @AcmeBundle/templates/acme.twig.html
with the Twig context ['my-data-label' => 'my data']
.
JSON
This will respond with
XML
This will respond with
Serialization
To use serialization groups in the serialization process, you can add the groups
option parameter.
For example:
All versions of response-content-negotiation-bundle with dependencies
friendsofsymfony/rest-bundle Version ^3.0
symfony/config Version ^6.0
symfony/contracts Version ^3.0
symfony/dependency-injection Version ^6.0
symfony/event-dispatcher Version ^6.0
symfony/http-foundation Version ^6.0
symfony/http-kernel Version ^6.0
symfony/twig-bundle Version ^6.0
twig/twig Version ^3.0
willdurand/negotiation Version ^3.0