PHP Trait Webiny\Component\Http\HttpTrait

Mostrar archivo Open project: Webiny/Framework

Protected Methods

Method Description
httpCookie ( ) : Cookie Get Cookie instance.
httpRedirect ( string | UrlObject $url, string | integer | array $headers = [], integer $redirectCode = 301 ) Redirect the request to the given url.
httpRequest ( ) : Request Get Request component instance.
httpResponse ( string $content = '', integer $statusCode = 200, array $headers = [] ) : Response Creates and returns a new Response instance.
httpSession ( ) : Session Get Session instance.

Method Details

httpCookie() protected static method

Get Cookie instance.
protected static httpCookie ( ) : Cookie
return Cookie

httpRedirect() protected static method

Redirect the request to the given url.
protected static httpRedirect ( string | UrlObject $url, string | integer | array $headers = [], integer $redirectCode = 301 )
$url string | Webiny\Component\StdLib\StdObject\UrlObject\UrlObject
$headers string | integer | array Headers that you wish to send with your request.
$redirectCode integer

httpRequest() protected static method

Get Request component instance.
protected static httpRequest ( ) : Request
return Request

httpResponse() protected static method

Creates and returns a new Response instance.
protected static httpResponse ( string $content = '', integer $statusCode = 200, array $headers = [] ) : Response
$content string Content that will be attached to the response.
$statusCode integer HTTP status code that will be sent back to the user.
$headers array Additional headers that should be attached to the response.
return Response

httpSession() protected static method

Get Session instance.
protected static httpSession ( ) : Session
return Session