Git Product home page Git Product logo

Comments (15)

cordoval avatar cordoval commented on July 27, 2024

@stof did this e7ef14a

I went to the file then hit history then searched uri and stof's commit gave the info

from knpmenu.

iJanki avatar iJanki commented on July 27, 2024

Thank you very much. So how do I get this functionality now?

$menu = $this->factory->createItem('root');
$menu->setCurrent($request->getRequestUri());

from knpmenu.

stof avatar stof commented on July 27, 2024

https://github.com/KnpLabs/KnpMenu/blob/master/doc/01-Basic-Menus.markdown#the-current-menu-item

from knpmenu.

cordoval avatar cordoval commented on July 27, 2024

yeah yeah @stof rocks

from knpmenu.

stof avatar stof commented on July 27, 2024

and if you use the bundle, you may be interested by my answer on KnpLabs/KnpMenuBundle#122

from knpmenu.

stof avatar stof commented on July 27, 2024

also, note that the master branch of KnpMenu and KnpMenuBundle are the development branches for 2.0, not a stable version. If you don't want any breakage in your app, use the stable releases of 1.1.x (1.1.0 for the bundle and 1.1.2 for the library)

from knpmenu.

iJanki avatar iJanki commented on July 27, 2024

Thank you, sorry I missed that doc.

from knpmenu.

umpirsky avatar umpirsky commented on July 27, 2024

Hehum. Am I missing something or this new item interface is really hard to use.

How can I set current url if I'm using KnpMenuBundle and rendering menus with twig? Looks like bundle doc is not up to date.

from knpmenu.

sergiomeneses avatar sergiomeneses commented on July 27, 2024

Yeah please update the documentation for KnpMenubundle i am a little stuck here with the current state for the items.

from knpmenu.

umpirsky avatar umpirsky commented on July 27, 2024

Any update on this. I see there is Knp\Menu\Matcher\Voter\UriVoter. How can we use it?

from knpmenu.

stof avatar stof commented on July 27, 2024

@umpirsky see KnpLabs/KnpMenuBundle#122 discussing it. I will probably not have time to work on the bundle before the weekend to register the voters directly in it.

from knpmenu.

umpirsky avatar umpirsky commented on July 27, 2024

@stof Thanks, I'll wait for that fix. So, after that fix, do we need to set current url?

from knpmenu.

umpirsky avatar umpirsky commented on July 27, 2024

Is there any tag/version so we can put it in composer.json and use old setCurrentUri API?

from knpmenu.

topwebstudio avatar topwebstudio commented on July 27, 2024

use version 1.1.0 i guess

from knpmenu.

seekmas avatar seekmas commented on July 27, 2024

Good advice

from knpmenu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.