FacturaScripts

Response
in package

FinalYes

Table of Contents

Constants

HTTP_BAD_REQUEST  = 400
HTTP_CONFLICT  = 409
HTTP_FORBIDDEN  = 403
HTTP_INTERNAL_SERVER_ERROR  = 500
HTTP_METHOD_NOT_ALLOWED  = 405
HTTP_NOT_FOUND  = 404
HTTP_OK  = 200
HTTP_UNAUTHORIZED  = 401
HTTP_UNPROCESSABLE_ENTITY  = 422

Properties

$headers  : ResponseHeaders
$content  : string
$cookies  : array<string|int, mixed>
$http_code  : int
$send_disabled  : bool
$sent  : bool

Methods

__construct()  : mixed
cookie()  : self
disableSend()  : self
download()  : void
file()  : void
getContent()  : string
getHttpCode()  : int
header()  : self
json()  : void
pdf()  : void
redirect()  : self
send()  : void
setContent()  : self
setHttpCode()  : self
setStatusCode()  : self
view()  : void
withoutCookie()  : self
sanitizeFileName()  : string
sendHeaders()  : void

Constants

HTTP_BAD_REQUEST

public mixed HTTP_BAD_REQUEST = 400

HTTP_CONFLICT

public mixed HTTP_CONFLICT = 409

HTTP_FORBIDDEN

public mixed HTTP_FORBIDDEN = 403

HTTP_INTERNAL_SERVER_ERROR

public mixed HTTP_INTERNAL_SERVER_ERROR = 500

HTTP_METHOD_NOT_ALLOWED

public mixed HTTP_METHOD_NOT_ALLOWED = 405

HTTP_NOT_FOUND

public mixed HTTP_NOT_FOUND = 404

HTTP_UNAUTHORIZED

public mixed HTTP_UNAUTHORIZED = 401

HTTP_UNPROCESSABLE_ENTITY

public mixed HTTP_UNPROCESSABLE_ENTITY = 422

Properties

$cookies

private array<string|int, mixed> $cookies

$send_disabled

private bool $send_disabled = false

Methods

__construct()

public __construct([int $http_code = 200 ]) : mixed
Parameters
$http_code : int = 200
public cookie(string $name, string|null $value[, int $expire = 0 ][, bool $httpOnly = true ][, bool|null $secure = null ][, string $sameSite = 'Lax' ]) : self
Parameters
$name : string
$value : string|null
$expire : int = 0
$httpOnly : bool = true
$secure : bool|null = null
$sameSite : string = 'Lax'
Return values
self

disableSend()

public disableSend([bool $disable = true ]) : self
Parameters
$disable : bool = true
Return values
self

download()

public download(string $file_path[, string $file_name = '' ]) : void
Parameters
$file_path : string
$file_name : string = ''

file()

public file(string $file_path[, string $file_name = '' ][, string $disposition = 'inline' ]) : void
Parameters
$file_path : string
$file_name : string = ''
$disposition : string = 'inline'

getContent()

public getContent() : string
Return values
string

getHttpCode()

public getHttpCode() : int
Return values
int

header()

public header(string $name, string $value) : self
Parameters
$name : string
$value : string
Return values
self

json()

public json(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

pdf()

public pdf(string $content[, string $file_name = '' ]) : void
Parameters
$content : string
$file_name : string = ''

redirect()

public redirect(string $url[, int $delay = 0 ]) : self
Parameters
$url : string
$delay : int = 0
Return values
self

setContent()

public setContent(string $content) : self
Parameters
$content : string
Return values
self

setHttpCode()

public setHttpCode(int $http_code) : self
Parameters
$http_code : int
Return values
self

setStatusCode()

public setStatusCode(int $http_code) : self

replaced by setHttpCode

Parameters
$http_code : int
Return values
self

view()

public view(string $view[, array<string|int, mixed> $data = [] ]) : void
Parameters
$view : string
$data : array<string|int, mixed> = []

withoutCookie()

public withoutCookie(string $name) : self
Parameters
$name : string
Return values
self

sanitizeFileName()

private sanitizeFileName(string $fileName[, string $prefix = 'file_' ][, string $suffix = '' ]) : string
Parameters
$fileName : string
$prefix : string = 'file_'
$suffix : string = ''
Return values
string

sendHeaders()

private sendHeaders() : void

        
On this page

Search results