public function pushRender()
    {
        if (isset($this->display_elements["graphic"])) {
            echo $this->display_elements["graphic"];
        } elseif (isset($this->display_elements["json"]) && $this->display_elements["json"] != "") {
            if (isset($this->display_elements["json"]['code'])) {
                @header(
                    $_SERVER['SERVER_PROTOCOL'] . ' ' .
                    (($this->display_elements["json"]['code'] == 000) ? 500 :
                        $this->display_elements["json"]['code']) . ' ' .
                    HttpResponse::getPhrase($this->display_elements["json"]['code']),
                    true,
                    $this->display_elements["json"]['code']
                );
                header('Content-type: application/json');
                header('Expires: 0');
                header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
                header('Pragma: public');
            }
            echo json_encode($this->display_elements["json"], JSON_PRETTY_PRINT);
        } elseif (isset($this->display_elements["xml"]) && $this->display_elements["xml"] != "") {
            header('Content-type: text/xml');
            header('Expires: 0');
            header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
            header('Pragma: public');
            echo ($this->display_elements["xml"]);
            if ($this->display_elements["name"] != null) {
                header('Content-Disposition: attachment; filename="'.$this->display_elements["name"].'.xml"');
            }
        } elseif (isset($this->display_elements["text"]) && $this->display_elements["text"] != "") {
            $rs = $this->assemblyTextRender();
            header("Content-Type: text/".$rs["type"]);
            echo ($rs["text"]);
        } elseif (isset($this->display_elements["csv"]) && $this->display_elements["csv"] != "") {
            $this->buildCsv();
        } elseif (isset($this->display_elements["custom"])) {
            if ($this->display_elements["custom"] == null) {
                $this->display_elements["custom"];
            } else {
                $this->display_elements["custom"]($this->display_elements["args"]);
            }
        } else {
            throw new Server500(new \ArrayObject(array("explain" => "Renderer: This renderer is not valid. ".
                json_encode($this->display_elements), "solution" =>
                "Please use a valid renderer.")));
        }
        $this->display_elements = array();
        exit(1);
    }
public function pushRender()
    {
        if (isset($this->display_elements["graphic"])) {
            echo $this->display_elements["graphic"];
        } elseif (isset($this->display_elements["json"]) && $this->display_elements["json"] != "") {
            if (isset($this->display_elements["json"]['code'])) {
                @header(
                    $_SERVER['SERVER_PROTOCOL'] . ' ' .
                    (($this->display_elements["json"]['code'] == 000) ? 500 :
                        $this->display_elements["json"]['code']) . ' ' .
                    HttpResponse::getPhrase($this->display_elements["json"]['code']),
                    true,
                    $this->display_elements["json"]['code']
                );
                header('Content-type: application/json');
                header('Expires: 0');
                header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
                header('Pragma: public');
            }
            echo json_encode($this->display_elements["json"], JSON_PRETTY_PRINT);
        } elseif (isset($this->display_elements["xml"]) && $this->display_elements["xml"] != "") {
            header('Content-type: text/xml');
            header('Expires: 0');
            header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
            header('Pragma: public');
            echo ($this->display_elements["xml"]);
            if ($this->display_elements["name"] != null) {
                header('Content-Disposition: attachment; filename="'.$this->display_elements["name"].'.xml"');
            }
        } elseif (isset($this->display_elements["text"]) && $this->display_elements["text"] != "") {
            $rs = $this->assemblyTextRender();
            header("Content-Type: text/".$rs["type"]);
            echo ($rs["text"]);
        } elseif (isset($this->display_elements["csv"]) && $this->display_elements["csv"] != "") {
            $this->buildCsv();
        } elseif (isset($this->display_elements["custom"])) {
            if ($this->display_elements["custom"] == null) {
                $this->display_elements["custom"];
            } else {
                $this->display_elements["custom"]($this->display_elements["args"]);
            }
        } else {
            throw new Server500(new \ArrayObject(array("explain" => "Renderer: This renderer is not valid. ".
                json_encode($this->display_elements), "solution" =>
                "Please use a valid renderer.")));
        }
        $this->display_elements = array();
        exit(1);
    }
public function pushRender ( ) { if ( isset ( $ this -> display_elements [ "graphic" ] ) ) { echo $ this -> display_elements [ "graphic" ] ; } elseif ( isset ( $ this -> display_elements [ "json" ] ) && $ this -> display_elements [ "json" ] != "" ) { if ( isset ( $ this -> display_elements [ "json" ] [ 'code' ] ) ) { @ header ( $ _SERVER [ 'SERVER_PROTOCOL' ] . ' ' . ( ( $ this -> display_elements [ "json" ] [ 'code' ] == 000 ) ? 500 : $ this -> display_elements [ "json" ] [ 'code' ] ) . ' ' . HttpResponse :: getPhrase ( $ this -> display_elements [ "json" ] [ 'code' ] ) , true , $ this -> display_elements [ "json" ] [ 'code' ] ) ; header ( 'Content-type: application/json' ) ; header ( 'Expires: 0' ) ; header ( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' ) ; header ( 'Pragma: public' ) ; } echo json_encode ( $ this -> display_elements [ "json" ] , JSON_PRETTY_PRINT ) ; } elseif ( isset ( $ this -> display_elements [ "xml" ] ) && $ this -> display_elements [ "xml" ] != "" ) { header ( 'Content-type: text/xml' ) ; header ( 'Expires: 0' ) ; header ( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' ) ; header ( 'Pragma: public' ) ; echo ( $ this -> display_elements [ "xml" ] ) ; if ( $ this -> display_elements [ "name" ] != null ) { header ( 'Content-Disposition: attachment; filename="' . $ this -> display_elements [ "name" ] . '.xml"' ) ; } } elseif ( isset ( $ this -> display_elements [ "text" ] ) && $ this -> display_elements [ "text" ] != "" ) { $ rs = $ this -> assemblyTextRender ( ) ; header ( "Content-Type: text/" . $ rs [ "type" ] ) ; echo ( $ rs [ "text" ] ) ; } elseif ( isset ( $ this -> display_elements [ "csv" ] ) && $ this -> display_elements [ "csv" ] != "" ) { $ this -> buildCsv ( ) ; } elseif ( isset ( $ this -> display_elements [ "custom" ] ) ) { if ( $ this -> display_elements [ "custom" ] == null ) { $ this -> display_elements [ "custom" ] ; } else { $ this -> display_elements [ "custom" ] ( $ this -> display_elements [ "args" ] ) ; } } else { throw new Server500 ( new \ ArrayObject ( array ( "explain" => "Renderer: This renderer is not valid. " . json_encode ( $ this -> display_elements ) , "solution" => "Please use a valid renderer." ) ) ) ; } $ this -> display_elements = array ( ) ; exit ( 1 ) ; }
Display element in display_element array
@return mixed
@throws Server500 if Code does not exist
Display element in display_element array