src/simple/Front.php
public function getContent(string $contentType = null): string
    {
/*
        if(null == $contentType)
            $contentType = $this->contentType;
*/
        switch($contentType) {
            case 'application/vnd.transitive.document+json':
                return $this->route->getDocument();
            break;
            case 'application/vnd.transitive.document+xml':
                return $this->route->getDocument()->asXML('document');
            break;
            case 'application/vnd.transitive.document+yaml':
                return $this->route->getDocument()->asYAML();
            break;
            case 'application/vnd.transitive.head+json':
                return $this->route->getHead()->asJson();
            break;
            case 'application/vnd.transitive.head+xml':
                return $this->route->getHead()->asXML('head');
            break;
            case 'application/vnd.transitive.head+yaml':
                return $this->route->getHead()->asYAML();
            break;
            case 'application/vnd.transitive.content+xhtml': case 'application/vnd.transitive.content+html':
                return $this->route->getContent();
            break;
            case 'application/vnd.transitive.content+json':
                return $this->route->getContent()->asJson();
            break;
            case 'application/vnd.transitive.content+xml':
                return $this->route->getContent()->asXML('content');
            break;
            case 'application/vnd.transitive.content+yaml':
                return $this->route->getContent()->asYAML();
            break;

            case 'text/plain':
                return $this->layout->getContent()->asString();
            break;

            case 'application/json':
                if($this->route->hasContent('application/json'))
                    return $this->route->getContentByType('application/json')->asJson();
                elseif(404 != http_response_code()) {
                    http_response_code(404);
                    $_SERVER['REDIRECT_STATUS'] = 404;

                    return '';
                }
            break;
            case 'application/xml':
                if($this->route->hasContent('application/xml'))
                    return $this->route->getContentByType('application/xml')->asJson();
                elseif(404 != http_response_code()) {
                    http_response_code(404);
                    $_SERVER['REDIRECT_STATUS'] = 404;

                    return '';
                }

            break;

            default:
                return $this->layout->getView();
        }
    }
public function getContent(string $contentType = null): string
    {
/*
        if(null == $contentType)
            $contentType = $this->contentType;
*/
        switch($contentType) {
            case 'application/vnd.transitive.document+json':
                return $this->route->getDocument();
            break;
            case 'application/vnd.transitive.document+xml':
                return $this->route->getDocument()->asXML('document');
            break;
            case 'application/vnd.transitive.document+yaml':
                return $this->route->getDocument()->asYAML();
            break;
            case 'application/vnd.transitive.head+json':
                return $this->route->getHead()->asJson();
            break;
            case 'application/vnd.transitive.head+xml':
                return $this->route->getHead()->asXML('head');
            break;
            case 'application/vnd.transitive.head+yaml':
                return $this->route->getHead()->asYAML();
            break;
            case 'application/vnd.transitive.content+xhtml': case 'application/vnd.transitive.content+html':
                return $this->route->getContent();
            break;
            case 'application/vnd.transitive.content+json':
                return $this->route->getContent()->asJson();
            break;
            case 'application/vnd.transitive.content+xml':
                return $this->route->getContent()->asXML('content');
            break;
            case 'application/vnd.transitive.content+yaml':
                return $this->route->getContent()->asYAML();
            break;

            case 'text/plain':
                return $this->layout->getContent()->asString();
            break;

            case 'application/json':
                if($this->route->hasContent('application/json'))
                    return $this->route->getContentByType('application/json')->asJson();
                elseif(404 != http_response_code()) {
                    http_response_code(404);
                    $_SERVER['REDIRECT_STATUS'] = 404;

                    return '';
                }
            break;
            case 'application/xml':
                if($this->route->hasContent('application/xml'))
                    return $this->route->getContentByType('application/xml')->asJson();
                elseif(404 != http_response_code()) {
                    http_response_code(404);
                    $_SERVER['REDIRECT_STATUS'] = 404;

                    return '';
                }

            break;

            default:
                return $this->layout->getView();
        }
    }
public function getContent ( string $ contentType = null ) : string { /*
        if(null == $contentType)
            $contentType = $this->contentType;
*/ switch ( $ contentType ) { case 'application/vnd.transitive.document+json' : return $ this -> route -> getDocument ( ) ; break ; case 'application/vnd.transitive.document+xml' : return $ this -> route -> getDocument ( ) -> asXML ( 'document' ) ; break ; case 'application/vnd.transitive.document+yaml' : return $ this -> route -> getDocument ( ) -> asYAML ( ) ; break ; case 'application/vnd.transitive.head+json' : return $ this -> route -> getHead ( ) -> asJson ( ) ; break ; case 'application/vnd.transitive.head+xml' : return $ this -> route -> getHead ( ) -> asXML ( 'head' ) ; break ; case 'application/vnd.transitive.head+yaml' : return $ this -> route -> getHead ( ) -> asYAML ( ) ; break ; case 'application/vnd.transitive.content+xhtml' : case 'application/vnd.transitive.content+html' : return $ this -> route -> getContent ( ) ; break ; case 'application/vnd.transitive.content+json' : return $ this -> route -> getContent ( ) -> asJson ( ) ; break ; case 'application/vnd.transitive.content+xml' : return $ this -> route -> getContent ( ) -> asXML ( 'content' ) ; break ; case 'application/vnd.transitive.content+yaml' : return $ this -> route -> getContent ( ) -> asYAML ( ) ; break ; case 'text/plain' : return $ this -> layout -> getContent ( ) -> asString ( ) ; break ; case 'application/json' : if ( $ this -> route -> hasContent ( 'application/json' ) ) return $ this -> route -> getContentByType ( 'application/json' ) -> asJson ( ) ; elseif ( 404 != http_response_code ( ) ) { http_response_code ( 404 ) ; $ _SERVER [ 'REDIRECT_STATUS' ] = 404 ; return '' ; } break ; case 'application/xml' : if ( $ this -> route -> hasContent ( 'application/xml' ) ) return $ this -> route -> getContentByType ( 'application/xml' ) -> asJson ( ) ; elseif ( 404 != http_response_code ( ) ) { http_response_code ( 404 ) ; $ _SERVER [ 'REDIRECT_STATUS' ] = 404 ; return '' ; } break ; default : return $ this -> layout -> getView ( ) ; } }
Return processed content from current route.

@return string

@param string $contentType = null
Return processed content from current route .