<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gisostallenberg / response-content-negotiation-bundle example snippets
namespace App\Controller;
use GisoStallenberg\Bundle\ResponseContentNegotiationBundle\Content\ResultData;
use GisoStallenberg\Bundle\ResponseContentNegotiationBundle\Content\ResultInterface;
use GisoStallenberg\Bundle\ResponseContentNegotiationBundle\Content\ResultServiceLocator;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
class AcmeController
{
/**
* @Route("/my-page", methods={"GET"})
*/
public function resultAction(
ResultServiceLocator $resultServiceLocator,
Request $request
): ResultInterface {
return $resultServiceLocator->getResult($request, new ResultData('acme', ['my-data-label' => 'my data']));
}
}
new ResultData('acme', ['my-data-label' => 'my data'], ['template' => '@AcmeBundle/templates/acme.twig.html'])
new ResultData('acme', ['my-data-label' => 'my data'], ['groups' => ['profile', 'list']])
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.