protected function chooseRenderer(array $accept) {
        $renderClass = 'none';
        foreach ($accept as $mimeType) {

            switch (trim(strtolower($mimeType))) {
                case 'text/html' : 
                case 'application/xhtml+xml':
                case '*/*':
                    $renderClass = 'html';
                    break 2;
                case 'application/json' :
                case 'text/json' : 
                    $renderClass = 'json';
                    break 2;
            }
            
        }

        if(tao_helpers_Request::isAjax()) {
            $renderClass = 'ajax';
        }

        $className = __NAMESPACE__ . '\\' . $this->rendererClassList[$renderClass];
        
        $renderer = new $className();
        
        return $renderer->setServiceLocator($this->getServiceLocator());
    }
protected function chooseRenderer(array $accept) {
        $renderClass = 'none';
        foreach ($accept as $mimeType) {

            switch (trim(strtolower($mimeType))) {
                case 'text/html' : 
                case 'application/xhtml+xml':
                case '*/*':
                    $renderClass = 'html';
                    break 2;
                case 'application/json' :
                case 'text/json' : 
                    $renderClass = 'json';
                    break 2;
            }
            
        }

        if(tao_helpers_Request::isAjax()) {
            $renderClass = 'ajax';
        }

        $className = __NAMESPACE__ . '\\' . $this->rendererClassList[$renderClass];
        
        $renderer = new $className();
        
        return $renderer->setServiceLocator($this->getServiceLocator());
    }
protected function chooseRenderer ( array $ accept ) { $ renderClass = 'none' ; foreach ( $ accept as $ mimeType ) { switch ( trim ( strtolower ( $ mimeType ) ) ) { case 'text/html' : case 'application/xhtml+xml' : case '*/*' : $ renderClass = 'html' ; break 2 ; case 'application/json' : case 'text/json' : $ renderClass = 'json' ; break 2 ; } } if ( tao_helpers_Request :: isAjax ( ) ) { $ renderClass = 'ajax' ; } $ className = __NAMESPACE__ . '\\' . $ this -> rendererClassList [ $ renderClass ] ; $ renderer = new $ className ( ) ; return $ renderer -> setServiceLocator ( $ this -> getServiceLocator ( ) ) ; }
search rendering method in function of request accept header
@param array $accept
@return ResponseAbstract
search rendering method in function of request accept header