class
Illuminate
/
Support
/
Js
Js
Implements
Constants
protected
REQUIRED_FLAGS int
Flags that should be used when encoding to JSON.
Default: int
Properties
protected
$js string
The JavaScript string.
Default: null
Methods
public
__construct ( $data , $flags , $depth ) : void
Create a new class instance.
Parameters
- $data mixed
- $flags int|null
- $depth int
public
static
from ( $data , $flags , $depth ) : static
Create a new JavaScript string from the given data.
Parameters
- $data mixed
- $flags int
- $depth int
protected
convertDataToJavaScriptExpression ( $data , $flags , $depth ) : string
Convert the given data to a JavaScript expression.
Parameters
- $data mixed
- $flags int
- $depth int
public
static
encode ( $data , $flags , $depth ) : string
Encode the given data as JSON.
Parameters
- $data mixed
- $flags int
- $depth int
protected
convertJsonToJavaScriptExpression ( $json , $flags ) : string
Convert the given JSON to a JavaScript expression.
Parameters
- $json string
- $flags int
public
toHtml ( ) : string
Get the string representation of the data for use in HTML.
public
__toString ( ) : string
Get the string representation of the data for use in HTML.