public function contentTypeFromAccept($accept) {
        if (!empty($this->headers['Content-Type'])) {
            return;
        }

        $accept = strtolower($accept);
        if (strpos($accept, ',') === false) {
            list($contentType) = explode(';', $accept);
        } elseif (strpos($accept, 'text/html') !== false) {
            $contentType = 'text/html';
        } elseif (strpos($accept, 'application/rss+xml' !== false)) {
            $contentType = 'application/rss+xml';
        } elseif (strpos($accept, 'text/plain')) {
            $contentType = 'text/plain';
        } else {
            $contentType = 'text/html';
        }
        $this->contentType($contentType);
        return $this;
    }
public function contentTypeFromAccept($accept) {
        if (!empty($this->headers['Content-Type'])) {
            return;
        }

        $accept = strtolower($accept);
        if (strpos($accept, ',') === false) {
            list($contentType) = explode(';', $accept);
        } elseif (strpos($accept, 'text/html') !== false) {
            $contentType = 'text/html';
        } elseif (strpos($accept, 'application/rss+xml' !== false)) {
            $contentType = 'application/rss+xml';
        } elseif (strpos($accept, 'text/plain')) {
            $contentType = 'text/plain';
        } else {
            $contentType = 'text/html';
        }
        $this->contentType($contentType);
        return $this;
    }
public function contentTypeFromAccept ( $ accept ) { if ( ! empty ( $ this -> headers [ 'Content-Type' ] ) ) { return ; } $ accept = strtolower ( $ accept ) ; if ( strpos ( $ accept , ',' ) === false ) { list ( $ contentType ) = explode ( ';' , $ accept ) ; } elseif ( strpos ( $ accept , 'text/html' ) !== false ) { $ contentType = 'text/html' ; } elseif ( strpos ( $ accept , 'application/rss+xml' !== false ) ) { $ contentType = 'application/rss+xml' ; } elseif ( strpos ( $ accept , 'text/plain' ) ) { $ contentType = 'text/plain' ; } else { $ contentType = 'text/html' ; } $ this -> contentType ( $ contentType ) ; return $ this ; }
Set the content type from an accept header.

@param string $accept The value of the accept header.
@return Response $this Returns `$this` for fluent calls.
Set the content type from an accept header .