System\Traits\ResponseMaker

Overview

ResponseMaker stores attributes the can be used to prepare a response from the server.


Protected Properties

protected int $statusCode

statusCode for the response

protected mixed $responseOverride

responseOverride for the standard controller response.

protected Symfony\Component\HttpFoundation\ResponseHeaderBag $responseHeaderBag

protected array $responseBrowserEvents

responseBrowserEvents for the AJAX framework.


Public Methods

public dispatchBrowserEvent()

public dispatchBrowserEvent($event, $data = null): void

dispatchBrowserEvent queues a browser event

public getBrowserEvents()

public getBrowserEvents(): array 

getBrowserEvents returns the queued browser events

public getResponseHeaders()

public getResponseHeaders(

): Symfony\Component\HttpFoundation\ResponseHeaderBag|null 

getResponseHeaders as a response header bag

public getStatusCode()

public getStatusCode(): int 

getStatusCode returns the status code for the current web response.

public makeResponse()

public makeResponse(mixed $contents): mixed 

makeResponse prepares a response that considers overrides and custom responses.

public setResponse()

public setResponse(mixed $response): void 

setResponse for the current page request cycle, this value takes priority over the standard response prepared by the controller.

public setResponseCookie()

public setResponseCookie(
    Symfony\Component\HttpFoundation\Cookie|mixed $cookie
): void 

setResponseCookie adds a cookie to the response.

public setResponseHeader()

public setResponseHeader(
    string $key,
    array|string $values,
    bool $replace = true
): void 

setResponseHeader value

public setStatusCode()

public setStatusCode(int $code): void 

Sets the status code for the current web response.