You are here

public static function MenuOptionsHelper::getSelectField in Views Menu Node Children Filter 8

Same name and namespace in other branches
  1. 8.2 src/MenuOptionsHelper.php \Drupal\views_menu_children_filter\MenuOptionsHelper::getSelectField()
  2. 3.0.x src/MenuOptionsHelper.php \Drupal\views_menu_children_filter\MenuOptionsHelper::getSelectField()

Gets a select field definition for selecting target menus.

Parameters

array $defaultValue:

Return value

array

1 call to MenuOptionsHelper::getSelectField()
MenuChildren::buildOptionsForm in src/Plugin/views/argument/MenuChildren.php
Provide a form to edit options for this plugin.

File

src/MenuOptionsHelper.php, line 48

Class

MenuOptionsHelper
Provides helper classes for getting an options array of menus

Namespace

Drupal\views_menu_children_filter

Code

public static function getSelectField($defaultValue = []) {
  return [
    '#type' => 'select',
    '#title' => t('Target menus'),
    '#description' => t('Select the menu(s) to scan for child entities. If no menu is selected, the first matching menu will be used.'),
    '#multiple' => TRUE,
    '#options' => self::getMenuOptions(),
    '#default_value' => $defaultValue,
  ];
}