PHP Class JBZoo\Utils\Http

Afficher le fichier Open project: jbzoo/utils Class Usage Examples

Méthodes publiques

Méthode Description
download ( string $filename ) : boolean Transmit headers that force a browser to display the download file dialog.
getHeaders ( ) : array Get all HTTP headers
nocache ( ) : boolean Sets the headers to prevent caching for the different browsers.
utf8 ( string $content_type = 'text/html' ) : boolean Transmit UTF-8 content headers if the headers haven't already been sent.

Method Details

download() public static méthode

Cross browser compatible. Only fires if headers have not already been sent.
public static download ( string $filename ) : boolean
$filename string The name of the filename to display to browsers
Résultat boolean

getHeaders() public static méthode

Get all HTTP headers
See also: https://github.com/symfony/http-foundation/blob/master/ServerBag.php
public static getHeaders ( ) : array
Résultat array

nocache() public static méthode

Different browsers support different nocache headers, so several headers must be sent so that all of them get the point that no caching should occur
public static nocache ( ) : boolean
Résultat boolean

utf8() public static méthode

Transmit UTF-8 content headers if the headers haven't already been sent.
public static utf8 ( string $content_type = 'text/html' ) : boolean
$content_type string The content type to send out
Résultat boolean