Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/01-Basic-Menus.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Let's face it, creating menus sucks. Menus - a common aspect of any
site - can range from being simple and mundane to giant monsters that
become a headache to code and maintain.
becomes a headache to code and maintain.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong. giant monsters is a plural, and so is Menus. I don't see which subject could be singular here to justify becomes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not being a native English speaker, I put my trust in Grammarly
Schermata del 2025-09-23 11-23-03

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does the "see more" says ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only displays a contextual menu where I can accept or dismiss the suggestion and flag it as incorrect.
Anyway, it seems wrong in this case. I'll propose a fix PR


This bundle solves the issue by giving you a small, yet powerful and flexible
framework for handling your menus. While most of the examples shown here
Expand All @@ -13,7 +13,7 @@ are simple, the menus can grow arbitrarily large and deep.
The menu framework centers around one main interface: `Knp\Menu\ItemInterface`.
Items are created by a factory implementing `Knp\Menu\FactoryInterface`.
It's best to think of each `ItemInterface` object as an `<li>` tag that can
hold children objects (`<li>` tags that are wrapped in a `<ul>` tag).
hold child objects (`<li>` tags that are wrapped in a `<ul>` tag).
For example:

```php
Expand Down Expand Up @@ -53,13 +53,13 @@ The above would render the following html code:
>The menu framework automatically adds `first` and `last` classes to each
>`<li>` tag at each level for easy styling. Notice also that a `current`
>class is added to the "current" menu item by URI and `current_ancestor`
>to its ancestors (the classes are configurable) The above example assumes
>to its ancestors (the classes are configurable). The above example assumes
>the menu is being rendered on the `/comments` page, making the Comments
>menu the "current" item.

When the menu is rendered, it's actually spaced correctly so that it appears
as shown in the source HTML. This is to allow for easier debugging and can
be turned off by passing the `true` as the second argument to the renderer.
be turned off by passing `true` as the second argument to the renderer.

```php
<?php
Expand Down
2 changes: 1 addition & 1 deletion doc/04-Iterators.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ foreach ($iterator as $item) {
## Filtering only displayed items

The `Knp\Menu\Iterator\DisplayedItemFilterIterator` allows you to filter
items to keep only displayed ones. As hiding an item also hides its children,
items to keep only the displayed ones. As hiding an item also hides its children,
this filter is a recursive filter iterator and is applied on the recursive
iterator, not on the flattened iterator.

Expand Down
4 changes: 2 additions & 2 deletions doc/05-Matcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class MyAwesomeVoter implements VoterInterface
}
```

Note: You can also write your own *matcher* that implements the `MatcherInterface`
if you need something different than the voter approach.
Note: You can also write your own *matcher* that implements the `MatcherInterface`,
if you need something different from the voter approach.

If you use the [KnpMenuBundle](https://symfony.com/bundles/KnpMenuBundle/current/index.html), the RouteVoter is automatically loaded.
6 changes: 3 additions & 3 deletions doc/examples/01_apply_active_class_to_whole_tree.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# How to apply the active class to a item and all ancestors
# How to apply the active class to an item and all ancestors

By default the active menu item is applied with a `current` class and its ancestors are applied with a `current_ancestor`
class. To apply a class other than the default or apply the same class to both you can either pass it as an option to the
By default, the active menu item is applied with a `current` class and its ancestors are applied with a `current_ancestor`
class. To apply a class other than the default or apply the same class to both, you can either pass it as an option to the
render method of your used renderer:

```php
Expand Down
2 changes: 1 addition & 1 deletion src/Knp/Menu/Renderer/RendererProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface RendererProviderInterface
*
* If null is given, a renderer marked as default is returned.
*
* @throws \InvalidArgumentException if the renderer does not exists
* @throws \InvalidArgumentException if the renderer does not exist
*/
public function get(?string $name = null): RendererInterface;

Expand Down