class ContentType

Properties

static $content_types

Methods

static  ContentType
createFromContent( string $content)

Create a new ContentType object extracting the type from a content string

static  string
guessContentType( string $content)

No description

__construct( string $content_type)

Constructor : defines the current URL and gets the routes

string
__toString()

No description

setContentType( string $content_type)

No description

string
getContentType()

No description

setContentTypeObject( ContentTypeInterface $content_type_object)

No description

object|null
getContentTypeObject()

No description

prepareContentType( string $content_type)

No description

void
prepareResponse( Response $response)

Prepare the content of the response before to send it to client

mixed
parseContent( string $content)

Parse an input content

string
prepareContent( mixed $content)

Prepare a content for output

Details

at line 61
static ContentType createFromContent( string $content)

Create a new ContentType object extracting the type from a content string

Parameters

string $content

Return Value

ContentType

at line 70
static string guessContentType( string $content)

Parameters

string $content

Return Value

string

at line 81
__construct( string $content_type)

Constructor : defines the current URL and gets the routes

Parameters

string $content_type

at line 89
string __toString()

Return Value

string

at line 103
ContentType setContentType( string $content_type)

Parameters

string $content_type

Return Value

ContentType

Exceptions

Exception if the content_type was not declared and unknown

at line 120
string getContentType()

Return Value

string

at line 129
ContentType setContentTypeObject( ContentTypeInterface $content_type_object)

Parameters

ContentTypeInterface $content_type_object

Return Value

ContentType

at line 139
object|null getContentTypeObject()

Return Value

object|null Object implementing the \HttpFundamental\ContentTypeInterface

at line 152
ContentType prepareContentType( string $content_type)

Parameters

string $content_type

Return Value

ContentType

at line 168
void prepareResponse( Response $response)

Prepare the content of the response before to send it to client

Parameters

Response $response

Return Value

void

at line 185
mixed parseContent( string $content)

Parse an input content

Parameters

string $content

Return Value

mixed

at line 201
string prepareContent( mixed $content)

Prepare a content for output

Parameters

mixed $content

Return Value

string