Comments (15)
I went to the file then hit history then searched uri and stof's commit gave the info
from knpmenu.
Thank you very much. So how do I get this functionality now?
$menu = $this->factory->createItem('root');
$menu->setCurrent($request->getRequestUri());
from knpmenu.
https://github.com/KnpLabs/KnpMenu/blob/master/doc/01-Basic-Menus.markdown#the-current-menu-item
from knpmenu.
yeah yeah @stof rocks
from knpmenu.
and if you use the bundle, you may be interested by my answer on KnpLabs/KnpMenuBundle#122
from knpmenu.
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.
Thank you, sorry I missed that doc.
from knpmenu.
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.
Yeah please update the documentation for KnpMenubundle i am a little stuck here with the current state for the items.
from knpmenu.
Any update on this. I see there is Knp\Menu\Matcher\Voter\UriVoter
. How can we use it?
from knpmenu.
@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.
@stof Thanks, I'll wait for that fix. So, after that fix, do we need to set current url?
from knpmenu.
Is there any tag/version so we can put it in composer.json and use old setCurrentUri API?
from knpmenu.
use version 1.1.0 i guess
from knpmenu.
Good advice
from knpmenu.
Related Issues (20)
- Allow Twig 3 HOT 3
- LazyProvider must be compatible with ... HOT 4
- Documentation HOT 1
- Label with hierarchical numbering 1.2.2.1
- Using pattern and route together HOT 7
- Apply "currentClass" in link in item HOT 2
- Change description HOT 4
- Add template for boostrap 4 etc.? HOT 3
- request attribute voter HOT 3
- Drop support for PHP 7.3? HOT 3
- Change \Knp\Menu\MenuFactory::getExtension to protected instead of private! HOT 4
- Matcher::addVoter() method undefined HOT 3
- Suggesting some configurations
- Add support for symfony 6.1 HOT 2
- What about PHP8.1 support? HOT 2
- Drop PHP 7 HOT 1
- Add ability to add items to menus in a sorted way HOT 1
- Document ESI usage
- Support Symfony 7
- getting the actual label, not the label ?? name HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knpmenu.