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

Ability to easily switch between <ol> and <ul> #2

Closed
caseyamcl opened this issue Feb 2, 2015 · 2 comments
Closed

Ability to easily switch between <ol> and <ul> #2

caseyamcl opened this issue Feb 2, 2015 · 2 comments

Comments

@caseyamcl
Copy link
Owner

Right now, the default formatter spits out [ul] lists. It is difficult to change this on-the-fly, so it should be a function parameter.

@swapnilbanga
Copy link

Any update on this?

@caseyamcl
Copy link
Owner Author

Hi @swapnilbanga ..after looking into this, I realize that you are right; the KnpMenu library doesn't include a way to easily specify the root element of a list outside of the Twig context. So, I created one.

I'm releasing a new version of TOC later today (v2.1) that fixes this, and allows you call: TocGenerator::getOrderedHtmlMenu() instead of TocGenerator::getMenu()

Note: v2.1 of the library requires PHP 7.1+, so if you're still on PHP5, you'll need to upgrade (or implement the changes yourself).

(new TOC\TocGenerator())->getOrderedListMenu($markup);

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

No branches or pull requests

2 participants