Skip to content

Commit

Permalink
Menu Node add extra
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Feb 14, 2024
1 parent ca37c97 commit 10c169c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/Menu/Tree/MenuNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class MenuNode extends Node implements MenuNodeInterface

protected ?bool $forceActive = null;

protected array $extra = [];

/**
* @var callable
*/
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 10c169c

Please sign in to comment.