You are here

protected function WorkspaceForm::generateMessageRenderArray in Workspace 8

Generate a message render array with the given text.

Parameters

string $type: The type of message: status, warning, or error.

string $message: The message to create with.

Return value

array The render array for a status message.

See also

\Drupal\Core\Render\Element\StatusMessages

1 call to WorkspaceForm::generateMessageRenderArray()
WorkspaceForm::form in src/Entity/Form/WorkspaceForm.php
Gets the actual form array to be built.

File

src/Entity/Form/WorkspaceForm.php, line 248

Class

WorkspaceForm
Form controller for the workspace edit forms.

Namespace

Drupal\workspace\Entity\Form

Code

protected function generateMessageRenderArray($type, $message) {
  return [
    '#theme' => 'status_messages',
    '#message_list' => [
      $type => [
        Markup::create($message),
      ],
    ],
  ];
}