1. Go to this page and download the library: Download dbstudios/doze library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dbstudios / doze example snippets
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
$serializer = new Serializer([
new DateTimeNormalizer(),
new ObjectNormalizer(),
], [
new JsonEncoder(),
]);
$responder = new Responder($serializer);
$response = $responder->createResponse('json', [
'name' => 'Example',
'someOtherField' => 'Value',
]);
echo $response->getContent();
// {"name":"Example","someOtherField":"Value"}
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use DaybreakStudios\Doze\Serializer\EntityNormalizer;
$serializer = new Serializer([
new DateTimeNormalizer(),
new EntityNormalizer(),
// EntityNormalizer must be added above less specific normalizers, like the ObjectNormalizer
new ObjectNormalizer(),
], [
new JsonEncoder(),
]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.