Request
in package
Request helpers
Table of Contents
Methods
- acceptJson() : bool
- Return true if request accept json
- acceptXml() : bool
- Return true if request accept xml
- getBrowserName() : string|null
- Get browser name
- getContentType() : mixed
- Return content type
- isHtmlContentType() : bool
- Return true if content type is html
- isJsonContentType() : bool
- Return true if content type is json
- isXmlContentType() : bool
- Return true if content type is xml
- parseAcceptHeader() : array<string|int, mixed>
- Parse accept header
Methods
acceptJson()
Return true if request accept json
public
static acceptJson(ServerRequestInterface $request) : bool
Parameters
- $request : ServerRequestInterface
Return values
boolacceptXml()
Return true if request accept xml
public
static acceptXml(ServerRequestInterface $request) : bool
Parameters
- $request : ServerRequestInterface
Return values
boolgetBrowserName()
Get browser name
public
static getBrowserName() : string|null
Return values
string|nullgetContentType()
Return content type
public
static getContentType(ServerRequestInterface $request[, string|null $default = 'text/html' ]) : mixed
Parameters
- $request : ServerRequestInterface
- $default : string|null = 'text/html'
isHtmlContentType()
Return true if content type is html
public
static isHtmlContentType(ServerRequestInterface $request) : bool
Parameters
- $request : ServerRequestInterface
Return values
boolisJsonContentType()
Return true if content type is json
public
static isJsonContentType(ServerRequestInterface $request) : bool
Parameters
- $request : ServerRequestInterface
Return values
boolisXmlContentType()
Return true if content type is xml
public
static isXmlContentType(ServerRequestInterface $request) : bool
Parameters
- $request : ServerRequestInterface
Return values
boolparseAcceptHeader()
Parse accept header
public
static parseAcceptHeader(ServerRequestInterface $request) : array<string|int, mixed>
Parameters
- $request : ServerRequestInterface