PHP Class Xpressengine\Presenter\Json\JsonPresenter

* API 로 출력할 때 출력방식을 JSON 으로 선택한 경우 동작
Author: XE Developers ([email protected])
Inheritance: implements Xpressengine\Presenter\Presentable, implements Illuminate\Contracts\Support\Jsonable
Show file Open project: xpressengine/xpressengine Class Usage Examples

Protected Properties

Property Type Description
$data array The array of view data.
$id string skin output id
$presenter Xpressengine\Presenter\Presenter

Public Methods

Method Description
__construct ( Presenter $presenter ) Create a new Renderer instance.
format ( ) : string Illuminate\Http\Request::initializeFormats() 에서 정의된 formats 에서 하나의 format
render ( ) : string return json format string
toArray ( ) : array Get the instance as an array.
toJson ( integer $options ) : string return json format string

Private Methods

Method Description
convert ( mixed $data, mixed $key = null ) : array data convert to array
getObjectToArray ( mixed $data ) : mixed | string get object to array

Method Details

__construct() public method

Create a new Renderer instance.
public __construct ( Presenter $presenter )
$presenter Xpressengine\Presenter\Presenter presenter

format() public static method

Illuminate\Http\Request::initializeFormats() 에서 정의된 formats 에서 하나의 format
public static format ( ) : string
return string

render() public method

return json format string
public render ( ) : string
return string

toArray() public method

Get the instance as an array.
public toArray ( ) : array
return array

toJson() public method

return json format string
public toJson ( integer $options ) : string
$options integer options
return string

Property Details

$data protected property

The array of view data.
protected array $data
return array

$id protected property

skin output id
protected string $id
return string

$presenter protected property

protected Presenter,Xpressengine\Presenter $presenter
return Xpressengine\Presenter\Presenter