Phlyty\App::halt PHP Method

halt() public method

Halts execution, and sets the response status code to $status, as well as sets the response body to the provided message (if any). Any previous content in the response body will be overwritten.
public halt ( integer $status, string $message = '' ) : void
$status integer HTTP response status
$message string HTTP response body
return void
    public function halt($status, $message = '')
    {
        $response = $this->response();
        $response->setStatusCode($status);
        $response->setContent($message);
        throw new Exception\HaltException();
    }