Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is extending the original renderer needed? #5

Open
Phillaf opened this issue Aug 23, 2015 · 0 comments
Open

Is extending the original renderer needed? #5

Phillaf opened this issue Aug 23, 2015 · 0 comments

Comments

@Phillaf
Copy link

Phillaf commented Aug 23, 2015

The ListRenderer mentions

Extend original to fix UL attributes

I believe this is a mistake. Knp uses <li> as the current node and <ul> as children nodes. Which make sense when you render a list like this

<li> <!-- current node -->

    <a href="#">This is a menu Item</a>

    <ul> <!-- children node -->

        <li><a hrtef="#">Submenu1</a></li>
        <li><a hrtef="#">Submenu2</a></li>

    </ul> 
</li>

When rendering a full menu, the topmost element is a <ul>, and therefore uses "children node" attributes.

However, by overriding the render() method and using getAttributes() both on <ul> and <li> tags, we're making setChildrenAttribute() pointless and we limit the flexibility provided in the default renderer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant