Documentation

ContentHeader
in package

Table of Contents

Constants

MEDIATYPE_HTML  = "text/html"
MEDIATYPE_JSON  = "application/json"
MEDIATYPE_PLAIN  = "text/plain"

Properties

$boundary  : mixed
$charset  : mixed
$media_type  : mixed

Methods

__construct()  : mixed
build()  : string
Builds the Content Header
Html()  : ContentHeader
Gets the content Header for Html Requests
Json()  : ContentHeader
Gets the content Header for Json Requests
Plain()  : ContentHeader
Gets the content Header for Plain Text Requests
send()  : bool
Sends the Header to the Browser

Constants

MEDIATYPE_JSON

public mixed MEDIATYPE_JSON = "application/json"

Properties

Methods

__construct()

public __construct(mixed $media_type[, mixed $charset = null ][, mixed $boundary = null ]) : mixed
Parameters
$media_type : mixed
$charset : mixed = null
$boundary : mixed = null

build()

Builds the Content Header

public build([mixed $charset = null ][, bool $include_type = true ]) : string
Parameters
$charset : mixed = null

Custom charset to overwrite the default one

$include_type : bool = true

Include the "Content-Type: " in front of the header

Return values
string

send()

Sends the Header to the Browser

public send([mixed $charset = null ]) : bool
Parameters
$charset : mixed = null

Custom charset to use

Return values
bool

        
On this page

Search results