Skip to content

Overriding Matcher::isAncestor method #410

@BoShurik

Description

@BoShurik

Hello.

I have a simple menu which contains top level links (e.g. Home, Orders, News etc). Concrete news are not included, as I don't render them and there are many of them.

Before 3.8.0 I extend \Knp\Menu\Matcher\Matcher and override isAncestor method so it can detect child pages by request uri and mark parent items as ancestors.

Now Matcher is final and I can't do that. I tried to decorate Matcher but it uses recursive calls so it's impossible to achieve what I want.

Is it possible to revert this change? Or there is another way to achieve this? (except copy pasting Matcher)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions