Skip to content

StatusCode

Set the status code to the response

  • Full name: \Zemit\Mvc\Controller\Traits\StatusCode

Methods

setStatusCode

Sets the status code and message for a response.

public setStatusCode(int $code = 200, string|null $message = null): \Phalcon\Http\ResponseInterface

Parameters:

Parameter Type Description
$code int The HTTP status code to set. Default is 200.
$message **string null**

Return Value:

The updated response object.