bocharsky-bw / activemenuitembundle Goto Github PK
View Code? Open in Web Editor NEWThe active menu item highlighter of simple HTML menu for Symfony framework
License: MIT License
The active menu item highlighter of simple HTML menu for Symfony framework
License: MIT License
Hi!
in method buildClassAttr the active and current classes are hardcoded to active
and active current
.
ActiveMenuItemBundle/src/BW/ActiveMenuItemBundle/Twig/BWExtension.php
Lines 177 to 185 in 382c5e1
While those are obvious "sane defaults", would be possible to be open for customization? Either in bundle config (not very flexible) or directly in funcion/filter call (quite flexible)
Hi there !
The BWExtension currently extends Twig_Extension which is deprecated since Twig 2.7 and was removed in Twig 3.0. Since composer.json does not require twig ^2.10 the extension breaks in newer applications.
There are two possible solutions.
@bocharsky-bw WDYT ?
Hey,
tree builder without root node was deprecated in Symfony 4.2.
"exception" => SilencedErrorContext {#903 ▼
+count: 2
-severity: E_USER_DEPRECATED
trace: {▼
/var/www/sf4/vendor/symfony/config/Definition/Builder/TreeBuilder.php:30 {▼
› if (null === $name) {
› @trigger_error('A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.', E_USER_DEPRECATED);
› } else {
}
/var/www/sf4/vendor/bw/active-menu-item-bundle/src/BW/ActiveMenuItemBundle/DependencyInjection/Configuration.php:20 {▼
› {
› $treeBuilder = new TreeBuilder();
› $rootNode = $treeBuilder->root('bw_active_menu_item');
}
}
}
The Fix could be something like this i think ( i might be wrong :-) )
$treeBuilder = new TreeBuilder('bw_active_menu_item');
if (\method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder->root('bw_active_menu_item');
}
Greetings,
WhiteRabbit
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.