Class Encoder

Summary

Fully Qualified Name: Laminas\Json\Encoder

Description

Encode PHP constructs to JSON.

Methods

Name Description Defined By
encode() Use the JSON encoding scheme for the value specified. Encoder
encodeClass() Encodes the given $className into the class2 model of encoding PHP classes into JavaScript class2 classes. Encoder
encodeClasses() Encode several classes at once. Encoder
encodeUnicodeString() Encode Unicode Characters to \u0000 ASCII syntax. Encoder

Method Details

encode()

Use the JSON encoding scheme for the value specified.

Parameter Name Type Description
$value mixed The
$cycleCheck bool Whether
$options array Additional

Returns: string The encoded value.

encodeClass()

Encodes the given $className into the class2 model of encoding PHP classes into JavaScript class2 classes.

NOTE: Currently only public methods and variables are proxied onto the client machine

Parameter Name Type Description
$package Optional
$className
$package

Returns: string The class2 (JavaScript) encoding of the class.

encodeClasses()

Encode several classes at once.

Returns JSON encoded classes, using {@link encodeClass()}.

Parameter Name Type Description
$classNames string[]
$package string

Returns: string

encodeUnicodeString()

Encode Unicode Characters to \u0000 ASCII syntax.

This algorithm was originally developed for the Solar Framework by Paul M. Jones.

Parameter Name Type Description
$value string

Returns: string

Top