public function jsonRenderer($elements): Renderer
    {
        if (!is_array($elements) && !is_object($elements)) {
            throw new Server500(new \ArrayObject(array("explain" =>
                "The parameters {elements} is not a valid object/array for json renderer ",
                "solution" => "Please set a valid parameters for json renderer {object|array}")));
        }

        $this->display_elements = array("json" => (array)$elements, JSON_PRETTY_PRINT);
        return ($this);
    }
public function jsonRenderer($elements): Renderer
    {
        if (!is_array($elements) && !is_object($elements)) {
            throw new Server500(new \ArrayObject(array("explain" =>
                "The parameters {elements} is not a valid object/array for json renderer ",
                "solution" => "Please set a valid parameters for json renderer {object|array}")));
        }

        $this->display_elements = array("json" => (array)$elements, JSON_PRETTY_PRINT);
        return ($this);
    }
public function jsonRenderer ( $ elements ) : Renderer { if ( ! is_array ( $ elements ) && ! is_object ( $ elements ) ) { throw new Server500 ( new \ ArrayObject ( array ( "explain" => "The parameters {elements} is not a valid object/array for json renderer " , "solution" => "Please set a valid parameters for json renderer {object|array}" ) ) ) ; } $ this -> display_elements = array ( "json" => ( array ) $ elements , JSON_PRETTY_PRINT ) ; return ( $ this ) ; }
Display json elements on screen
@param array|\stdClass $elements Array to tranform to json format
@return Renderer The renderer object
@throws Server500 If element is not a valid array or object
Display json elements on screen