You are here

public function AdvancedPluginSelectorBase::buildNoAvailablePlugins in Plugin 8.2

Builds the form elements for when there are no available plugins.

File

src/Plugin/Plugin/PluginSelector/AdvancedPluginSelectorBase.php, line 231

Class

AdvancedPluginSelectorBase
Provides a default base for most plugin selectors.

Namespace

Drupal\plugin\Plugin\Plugin\PluginSelector

Code

public function buildNoAvailablePlugins(array $element, FormStateInterface $form_state) {
  $element['select']['container'] = [
    '#type' => 'container',
  ];
  $element['select']['container']['plugin_id'] = [
    '#type' => 'value',
    '#value' => NULL,
  ];
  $element['select']['message'] = [
    '#markup' => $this
      ->t('There are no available options.'),
    '#title' => $this
      ->getLabel(),
    '#type' => 'item',
  ];
  return $element;
}