function MenuParentFormSelectorInterface::getParentSelectOptions

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/MenuParentFormSelectorInterface.php \Drupal\Core\Menu\MenuParentFormSelectorInterface::getParentSelectOptions()
  2. 8.9.x core/lib/Drupal/Core/Menu/MenuParentFormSelectorInterface.php \Drupal\Core\Menu\MenuParentFormSelectorInterface::getParentSelectOptions()
  3. 11.x 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.

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);

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