You are here

protected function EmitController::buildJsonStatusResponse in Radioactivity 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Controller/EmitController.php \Drupal\radioactivity\Controller\EmitController::buildJsonStatusResponse()

Creates a JSON status message response.

Parameters

string $status: The status content of the response.

string $message: The message content of the response.

Return value

\Symfony\Component\HttpFoundation\JsonResponse The response.

1 call to EmitController::buildJsonStatusResponse()
EmitController::emit in src/Controller/EmitController.php
Callback for /radioactivity/emit.

File

src/Controller/EmitController.php, line 94

Class

EmitController
Controller for radioactivity emit routes.

Namespace

Drupal\radioactivity\Controller

Code

protected function buildJsonStatusResponse($status, $message) {
  return new JsonResponse([
    'status' => $status,
    'message' => $message,
  ]);
}