You are here

public function FreelinkingManager::createErrorElement in Freelinking 8.3

Same name and namespace in other branches
  1. 4.0.x src/FreelinkingManager.php \Drupal\freelinking\FreelinkingManager::createErrorElement()

Create the error element when plugin not found.

Parameters

string $indicator: The name of the failed indicator.

Return value

array The render array to render the error element.

Overrides FreelinkingManagerInterface::createErrorElement

File

src/FreelinkingManager.php, line 160

Class

FreelinkingManager
Freelinking plugin manager.

Namespace

Drupal\freelinking

Code

public function createErrorElement($indicator) {
  $message = $this
    ->t('Missing plugin indicator');
  if ('NONE' !== $indicator) {
    $message = $this
      ->t('Unknown plugin indicator');
  }
  return [
    '#theme' => [
      'freelink_error',
      'freelink_error__' . $indicator,
    ],
    '#message' => $message,
    '#plugin' => $indicator,
    '#attributes' => [],
  ];
}