function MenuLinkTreeElement::__construct
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Menu/MenuLinkTreeElement.php \Drupal\Core\Menu\MenuLinkTreeElement::__construct()
- 10 core/lib/Drupal/Core/Menu/MenuLinkTreeElement.php \Drupal\Core\Menu\MenuLinkTreeElement::__construct()
- 9 core/lib/Drupal/Core/Menu/MenuLinkTreeElement.php \Drupal\Core\Menu\MenuLinkTreeElement::__construct()
- 8.9.x core/lib/Drupal/Core/Menu/MenuLinkTreeElement.php \Drupal\Core\Menu\MenuLinkTreeElement::__construct()
Constructs a new \Drupal\Core\Menu\MenuLinkTreeElement.
Parameters
\Drupal\Core\Menu\MenuLinkInterface $link: The menu link for this element in the menu link tree.
bool $hasChildren: A flag as to whether this element has children even if they are not included in the tree (i.e. this may be TRUE even if $subtree is empty).
int $depth: The depth of this element relative to the tree root.
bool $inActiveTrail: A flag as to whether this link was included in the list of active trail IDs used to build the tree.
\Drupal\Core\Menu\MenuLinkTreeElement[] $subtree: The children of this element in the menu link tree.
File
-
core/
lib/ Drupal/ Core/ Menu/ MenuLinkTreeElement.php, line 64
Class
- MenuLinkTreeElement
- Provides a value object to model an element in a menu link tree.
Namespace
Drupal\Core\MenuCode
public function __construct(public MenuLinkInterface $link, public $hasChildren, public $depth, public $inActiveTrail, public array $subtree) {
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.