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_HTML
public
mixed
MEDIATYPE_HTML
= "text/html"
MEDIATYPE_JSON
public
mixed
MEDIATYPE_JSON
= "application/json"
MEDIATYPE_PLAIN
public
mixed
MEDIATYPE_PLAIN
= "text/plain"
Properties
$boundary
public
mixed
$boundary
$charset
public
mixed
$charset
$media_type
public
mixed
$media_type
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
stringHtml()
Gets the content Header for Html Requests
public
static Html() : ContentHeader
Return values
ContentHeaderJson()
Gets the content Header for Json Requests
public
static Json() : ContentHeader
Return values
ContentHeaderPlain()
Gets the content Header for Plain Text Requests
public
static Plain() : ContentHeader
Return values
ContentHeadersend()
Sends the Header to the Browser
public
send([mixed $charset = null ]) : bool
Parameters
- $charset : mixed = null
-
Custom charset to use