diff --git a/src/Menu/Tree/MenuNode.php b/src/Menu/Tree/MenuNode.php index 6ade9f49..c018ba57 100644 --- a/src/Menu/Tree/MenuNode.php +++ b/src/Menu/Tree/MenuNode.php @@ -37,6 +37,8 @@ class MenuNode extends Node implements MenuNodeInterface protected ?bool $forceActive = null; + protected array $extra = []; + /** * @var callable */ @@ -370,4 +372,28 @@ public function setMenuHelper(MenuHelper $menuHelper): static return $this; } + + public function &getExtra(): array + { + return $this->extra; + } + + public function setExtra(array $extra): static + { + $this->extra = $extra; + + return $this; + } + + public function setExtraValue(string $name, mixed $value): static + { + $this->extra[$name] = $value; + + return $this; + } + + public function getExtraValue(string $name): mixed + { + return $this->extra[$name] ?? null; + } }