You are here

public function ExternalHreflang::form in External Hreflang 8

Generate a form element for this meta tag.

Parameters

array $element: The existing form element to attach to.

Return value

array The completed form element.

Overrides MetaNameBase::form

File

src/Plugin/metatag/Tag/ExternalHreflang.php, line 66

Class

ExternalHreflang
A new hreflang tag will be made available for each language.

Namespace

Drupal\external_hreflang\Plugin\metatag\Tag

Code

public function form(array $element = []) {
  $form = [
    '#type' => 'textarea',
    '#title' => $this
      ->label(),
    '#default_value' => $this
      ->value(),
    '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
    '#description' => $this
      ->description(),
    '#element_validate' => [
      [
        get_class($this),
        'validateTag',
      ],
    ],
  ];
  return $form;
}