private function _format($data) {
        $output_callback_function = '';
        
        // If data is in array format then set content-type
        // to application/json
        if (is_array($data) || is_object($data)) {
            $this->header('Content-type: application/json');
            // Convert to json
            $output_callback_function = json_encode($data);
        } else {
            // Default
            $output_callback_function = $data;
        }
        
        $output = $output_callback_function;
        
        // GZIP output compression
        if ($this->_compress) {
            // Set Content coding a gzip
            $this->header('Content-Encoding: gzip');
            
            // Set headers for gzip
            $output = "\x1f\x8b\x08\x00\x00\x00\x00\x00";
            $output .= gzcompress($output_callback_function);
        }
        
        return $output;
    }
private function _format($data) {
        $output_callback_function = '';
        
        // If data is in array format then set content-type
        // to application/json
        if (is_array($data) || is_object($data)) {
            $this->header('Content-type: application/json');
            // Convert to json
            $output_callback_function = json_encode($data);
        } else {
            // Default
            $output_callback_function = $data;
        }
        
        $output = $output_callback_function;
        
        // GZIP output compression
        if ($this->_compress) {
            // Set Content coding a gzip
            $this->header('Content-Encoding: gzip');
            
            // Set headers for gzip
            $output = "\x1f\x8b\x08\x00\x00\x00\x00\x00";
            $output .= gzcompress($output_callback_function);
        }
        
        return $output;
    }
private function _format ( $ data ) { $ output_callback_function = '' ; // If data is in array format then set content-type // to application/json if ( is_array ( $ data ) || is_object ( $ data ) ) { $ this -> header ( 'Content-type: application/json' ) ; // Convert to json $ output_callback_function = json_encode ( $ data ) ; } else { // Default $ output_callback_function = $ data ; } $ output = $ output_callback_function ; // GZIP output compression if ( $ this -> _compress ) { // Set Content coding a gzip $ this -> header ( 'Content-Encoding: gzip' ) ; // Set headers for gzip $ output = "\x1f\x8b\x08\x00\x00\x00\x00\x00" ; $ output .= gzcompress ( $ output_callback_function ) ; } return $ output ; }
Return string value for data

@access  private
@param   object  $data   Data to convert
@return  string
Return string value for data