public function setResponseType($responseType = 'array')
    {
        $supportedFormats = array('json', 'html', 'extjs', 'text', 'png');

        if (in_array($responseType, $supportedFormats)) {
            $this->fakeType = false;
            $this->responseType = $responseType;
        } else {
            switch ($responseType) {
                case 'pngb64':
                    $this->fakeType = 'pngb64';
                    $this->responseType = 'png';
                    break;
                case 'object':
                case 'array':
                    $this->responseType = 'json';
                    $this->fakeType = $responseType;
                    break;
                default:
                    $this->responseType = 'json';
                    $this->fakeType = 'array'; // Default format
            }
        }
    }
public function setResponseType($responseType = 'array')
    {
        $supportedFormats = array('json', 'html', 'extjs', 'text', 'png');

        if (in_array($responseType, $supportedFormats)) {
            $this->fakeType = false;
            $this->responseType = $responseType;
        } else {
            switch ($responseType) {
                case 'pngb64':
                    $this->fakeType = 'pngb64';
                    $this->responseType = 'png';
                    break;
                case 'object':
                case 'array':
                    $this->responseType = 'json';
                    $this->fakeType = $responseType;
                    break;
                default:
                    $this->responseType = 'json';
                    $this->fakeType = 'array'; // Default format
            }
        }
    }
public function setResponseType ( $ responseType = 'array' ) { $ supportedFormats = array ( 'json' , 'html' , 'extjs' , 'text' , 'png' ) ; if ( in_array ( $ responseType , $ supportedFormats ) ) { $ this -> fakeType = false ; $ this -> responseType = $ responseType ; } else { switch ( $ responseType ) { case 'pngb64' : $ this -> fakeType = 'pngb64' ; $ this -> responseType = 'png' ; break ; case 'object' : case 'array' : $ this -> responseType = 'json' ; $ this -> fakeType = $ responseType ; break ; default : $ this -> responseType = 'json' ; $ this -> fakeType = 'array' ; // Default format } } }
Sets the response type that is going to be returned when doing requests.

@param string $responseType One of json, html, extjs, text, png.
Sets the response type that is going to be returned when doing requests .