You are here

public function MenuParentFormSelectorInterface::getParentSelectOptions in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Menu/MenuParentFormSelectorInterface.php \Drupal\Core\Menu\MenuParentFormSelectorInterface::getParentSelectOptions()

Gets the options for a select element to choose a menu and parent.

Parameters

string $id: Optional ID of a link plugin. This will exclude the link and its children from the select options.

array $menus: Optional array of menu names as keys and titles as values to limit the select options. If NULL, all menus will be included.

\Drupal\Core\Cache\CacheableMetadata|null &$cacheability: Optional cacheability metadata object, which will be populated based on the accessibility of the links and the cacheability of the links.

Return value

array Keyed array where the keys are contain a menu name and parent ID and the values are a menu name or link title indented by depth.

1 method overrides MenuParentFormSelectorInterface::getParentSelectOptions()
MenuParentFormSelector::getParentSelectOptions in core/lib/Drupal/Core/Menu/MenuParentFormSelector.php
Gets the options for a select element to choose a menu and parent.

File

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

Class

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

Namespace

Drupal\Core\Menu

Code

public function getParentSelectOptions($id = '', array $menus = NULL, CacheableMetadata &$cacheability = NULL);