JsonSerializableNormalizer::denormalize()

object denormalize(mixed $data, string $class, string $format = null, array $context = array()) Denormalizes data back into an object of the given class. Parameters mixed $data data to restore string $class the expected class to instantiate string $format format the given data was extracted from array $context options available to the denormalizer Return Value object

JsonSerializableNormalizer

class JsonSerializableNormalizer extends AbstractNormalizer A normalizer that uses an objects own JsonSerializable implementation. Traits SerializerAwareTrait SerializerAware trait. Constants CIRCULAR_REFERENCE_LIMIT OBJECT_TO_POPULATE GROUPS Methods setSerializer(SerializerInterface $serializer) Sets the serializer. from SerializerAwareTrait __construct(ClassMetadataFactoryInterface $classMetadataFactory = null, NameConverterInterface $nameConverter = null) Sets

JsonResponse::setJson()

JsonResponse setJson(string $json) Sets a raw string containing a JSON document to be sent. Parameters string $json Return Value JsonResponse Exceptions InvalidArgumentException

JsonResponse::setEncodingOptions()

JsonResponse setEncodingOptions(int $encodingOptions) Sets options used while encoding data to JSON. Parameters int $encodingOptions Return Value JsonResponse

JsonResponse::setData()

JsonResponse setData(mixed $data = array()) Sets the data to be sent as JSON. Parameters mixed $data Return Value JsonResponse Exceptions InvalidArgumentException

JsonResponse::setCallback()

JsonResponse setCallback(string|null $callback = null) Sets the JSONP callback. Parameters string|null $callback The JSONP callback or null to use none Return Value JsonResponse Exceptions InvalidArgumentException When the callback name is not valid

JsonResponse::getEncodingOptions()

int getEncodingOptions() Returns options used while encoding data to JSON. Return Value int

JsonResponse::create()

static Response create(mixed $data = null, int $status = 200, array $headers = array()) Factory method for chainability. Example: return JsonResponse::create($data, 200) ->setSharedMaxAge(300); Parameters mixed $data The json response data int $status The response status code array $headers An array of response headers Return Value Response

JsonResponse

class JsonResponse extends Response Response represents an HTTP response in JSON format. Note that this class does not force the returned JSON content to be an object. It is however recommended that you do return an object as it protects yourself against XSSI and JSON-JavaScript Hijacking. Constants HTTP_CONTINUE HTTP_SWITCHING_PROTOCOLS HTTP_PROCESSING HTTP_OK HTTP_CREATED HTTP_ACCEPTED HTTP_NON_AUTHORITATIVE_INFORMATION HTTP_NO_CONTENT HTTP_RESET_CONTENT

JsonFileLoader

class JsonFileLoader extends FileLoader JsonFileLoader loads translations from an json file. Methods MessageCatalogue load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. from FileLoader Details MessageCatalogue load(mixed $resource, string $locale, string $domain = 'messages') Loads a locale. Parameters mixed $resource A resource string $locale A locale string $domain The domain Return Value MessageCatalogue A Me