Coder Social home page Coder Social logo

activemenuitembundle's People

Contributors

beyerjc avatar bocharsky-bw avatar c3fr4 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

activemenuitembundle's Issues

Hardcoded active & current class names

Hi!

in method buildClassAttr the active and current classes are hardcoded to active and active current.

protected function buildClassAttr($isCurrent, $isActive) {
$result = '';
if (true === $isCurrent) {
$result = 'current active';
} elseif (true === $isActive) {
$result = 'active';
}

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)

Compatibility with Twig 3.0

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.

  1. restrict the twig version in the composer.json which is... not ideal i think
    or
  2. Change the extend to AbstractExtension and release the bundle in version 2.0

@bocharsky-bw WDYT ?

Deprecation Error - Symfony 4.2 - Configuration TreeBuilder

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

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.