Skip to content

Commit

Permalink
Rename builder's "alias" option to "menu".
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Nikolaev committed Nov 26, 2020
1 parent dc97fda commit 4f77d90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Builder/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function buildMenu(array $options = []): ItemInterface
$options = $this->getOptionsResolver()->resolve($options);

if (null === $menuAlias) {
$menuAlias = $options['alias'];
$menuAlias = $options['menu'];
}

$root = $this->itemFactoryPool->createItem($menuAlias);
Expand Down Expand Up @@ -461,8 +461,8 @@ private function configureOptions(OptionsResolver $resolver): void

if (null === $this->menuAlias) {
$resolver
->setRequired('alias')
->setAllowedTypes('alias', 'string');
->setRequired('menu')
->setAllowedTypes('menu', 'string');
}
}

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ darvin_menu:
equals to

```twig
{{ knp_menu_render(knp_menu_get('darvin_menu', [], {'alias': 'top'})) }}
{{ knp_menu_render(knp_menu_get('darvin_menu', [], {'menu': 'top'})) }}
```

but in the last case alias may be defined in runtime.

0 comments on commit 4f77d90

Please sign in to comment.