You are here

public function AggregationLevel::form in AGLS Metadata 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/AggregationLevel.php, line 27

Class

AggregationLevel
The AGLS Aggregation Level tag.

Namespace

Drupal\agls\Plugin\metatag\Tag

Code

public function form(array $element = array()) {
  $form = parent::form($element);
  $form['#type'] = 'select';
  $values = [
    'item',
    'collection',
  ];
  $form['#options'] = array_combine($values, $values);
  $form['#empty_option'] = $this
    ->t('None');
  return $form;
}