function MenuParentFormSelectorInterface::parentSelectElement

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/MenuParentFormSelectorInterface.php \Drupal\Core\Menu\MenuParentFormSelectorInterface::parentSelectElement()
  2. 8.9.x core/lib/Drupal/Core/Menu/MenuParentFormSelectorInterface.php \Drupal\Core\Menu\MenuParentFormSelectorInterface::parentSelectElement()
  3. 10 core/lib/Drupal/Core/Menu/MenuParentFormSelectorInterface.php \Drupal\Core\Menu\MenuParentFormSelectorInterface::parentSelectElement()

Gets a form element to choose a menu and parent.

The specific type of form element will vary depending on the implementation, but callers will normally need to set the #title for the element.

Parameters

string $menu_parent: A menu name and parent ID concatenated with a ':' character to use as the default value.

string $id: (optional) ID of a link plugin. This will exclude the link and its children from being selected.

array $menus: (optional) Array of menu names as keys and titles as values to limit the values that may be selected. If NULL, all menus will be included.

Return value

array A form element to choose a parent, or an empty array if no possible parents exist for the given parameters. The resulting form value will be a single string containing the chosen menu name and parent ID separated by a ':' character.

1 method overrides MenuParentFormSelectorInterface::parentSelectElement()
MenuParentFormSelector::parentSelectElement in core/lib/Drupal/Core/Menu/MenuParentFormSelector.php
Gets a form element to choose a menu and parent.

File

core/lib/Drupal/Core/Menu/MenuParentFormSelectorInterface.php, line 54

Class

MenuParentFormSelectorInterface
Defines an interface for menu selector form elements and menu link options.

Namespace

Drupal\Core\Menu

Code

public function parentSelectElement($menu_parent, $id = '', ?array $menus = NULL);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.