braincrafted / bootstrap-bundle

BraincraftedBootstrapBundle integrates Bootstrap into Symfony2 by providing templates, Twig extensions, services and commands.
http://bootstrap.braincrafted.com
MIT License
399 stars 182 forks source link

KnpMenuBundle Issue #28

Closed 1ukaz closed 11 years ago

1ukaz commented 11 years ago

Hi everyone ! First of all, thanks for the GREAT job !!

I configured your menu template as the default template for the KnpMenuBundle which I am using, but I get this error:

Variable "matcher" does not exist in /mnt/sshfs/code/Harren/Sniper/vendor/braincrafted/bootstrap-bundle/Braincrafted/BootstrapBundle/Resources/views/Menu/menu.html.twig at line 100

I tried removing the lines involving the matcher in an overriden template of menu.html.twig, but the menu breaks up ...

Can you point me at the right direction for resolving this? Thanks a lot !! Is kind of urgent ...

I am using Symfony version 2.2.1 Braincrafted version "1.3.1" KnpMenuBundle version was instaled via composer from the dev-master branch by some bundle needing it, don't recall which one. On my composer.json I have "knplabs/knp-paginator-bundle": "dev-master",

florianeckerstorfer commented 11 years ago

Do you have recent versions of KnpMenuBundle AND KnpMenu installed. They should be installed in vendor/knplabs/knp-menu-bundle and vendor/knplabs/knp-menu?

1ukaz commented 11 years ago

Yeah. As far as I can tell, I have both latest versions ... They are installed exactly where you are pointing. But don't know where to look for the specific version ... At the changelog.md file from KnpMenu, the last entry says 1.1.2. No idea regarding the KnpMenuBundle; couldn't find any file telling me something about the version. Any ideas?

florianeckerstorfer commented 11 years ago

That's strange. Do you somehow include the menu.html.twig directly? Or do you use another rendering engine. The matcher variable should set by Knp\Menu\Renderer\TwigRenderer.

Do you have some other configuration related to KnpMenu? If yes, could you post it.

1ukaz commented 11 years ago

Thanks man. Yes I have at my config.yml:

knp_menu:
   twig:
       template: "BraincraftedBootstrapBundle:Menu:menu.html.twig"

which I replicated it from another working Symfony 2.1 Project I must say that I am pretty new to Symfony from scratch ... Sorry

1ukaz commented 11 years ago

I've checked the file Knp\Menu\Renderer\TwigRenderer against one of a previous/different version of the bundle and the matcher variable is not there ... Not even is a __construct() param ... Any clues?

1ukaz commented 11 years ago

In fact, the MatcherInterface Class, nor even the Matcher Folder is there. It seems like the whole architecture has been modified; isn't it ?

florianeckerstorfer commented 11 years ago

Yes, but that was 11 month ago (see https://github.com/KnpLabs/KnpMenu/commit/a90d389e9d3d76d37abcbf2634f8ce62cd5e1e49#src/Knp/Menu/Renderer/TwigRenderer.php). You need to update KnpMenu to a newer version. Check if any bundle has set a specific version of KnpMenu. Or maybe it helps if you delete the vendor/knplabs directory and run composer update again.

1ukaz commented 11 years ago

Ok. Sounds fair enough to give it a try. Tomorrow when I return to work I will follow that approach and I will keep you posted. Thank you so much !! Tomorrow I will let you know how it worked !!

1ukaz commented 11 years ago

After leave at work I figured out that the Sonata Admin Bundle is requiring: "knplabs/knp-menu-bundle": "~1.1",

And KnpMenuBundle is also requiring: "knplabs/knp-menu": "1.1.*",

As far as I know is a big and very useful Bundle; Do you know any way of fixing this? I love Braincrafted Bootstrap Bundle !! Is awesome for the layout ... Thanks in advance

florianeckerstorfer commented 11 years ago

I would recommend that you use BootstrapBundle not for the menu stuff. Just remove the menu configuration from your config.yml and build your own template for the menu. You can take my template as a starting point.

Sent from my iPad

On 19.03.2013, at 22:38, Lucas Guegnolle notifications@github.com wrote:

After leave at work I figured out that the Sonata Admin Bundle is requiring: "knplabs/knp-menu-bundle": "~1.1",

As far as I know is a big and very useful Bundle; Do you know any way of fixing this? I love Braincrafted Bootstrap Bundle !! Is awesome for the layout ... Thanks in advance

— Reply to this email directly or view it on GitHub.

1ukaz commented 11 years ago

Thanks !! the thing is that I don't have time to that ... I am pointing my composer.json to your dev-master branch; maybe I could point it to some older version, which happen to be compatible with the last stable version of KnpMenu [1.1.*]. Can you tell me which version of Braincrafted can I use? Thanks a lot !!

florianeckerstorfer commented 11 years ago

When I started BootstrapBundle the matcher variable already existed. So I can't help you. But maybe there are other bundles that integrate Twitter Bootstrap and are compatible with your code. — florian@eckerstorfer.co Twitter: @Florian_ ADN: @florian

On Wed, Mar 20, 2013 at 4:18 PM, Lucas Guegnolle notifications@github.com wrote:

Thanks !! the thing is that I don't have time to that ... I am pointing my composer.json to your dev-master branch; maybe I could point it to some older version, which happen to be compatible with the last stable version of KnpMenu [1.1.*]. Can you tell me which version of Braincrafted can I use?

Thanks a lot !!

Reply to this email directly or view it on GitHub: https://github.com/braincrafted/bootstrap-bundle/issues/28#issuecomment-15181886

1ukaz commented 11 years ago

Well I've been downloading the .tar.gzs and browsing/checking every /Resources/views/Menu/menu.html.twig from every single one of the tagged versions of this Bundle, and they all seems to relay on the matcher object to render the Menu. Meaning that all versions of this Bundle requires a NON-STABLE version of the KnpMenu Bundle. I am really very gracefull for your job, but let me say, that is not MY code here; is about releasing versions that should be compatible with THE LAST STABLE version of the Bundle which they collaborate/depend/complement. I mean, if I use SonataAdminBundle, which requires/is compatible with the LAST STABLE VERSION of KnpMenu Bundle, you should have done the same ... The matcher variable already existed on a development version ... Is just a thought Thanks anyway for the help !!

florianeckerstorfer commented 11 years ago

Fixed in v1.3.2

1ukaz commented 11 years ago

Issue #29: Bootsrap-bundle doesn't work with knplabs/knp-menu-bundle v1.1.x-dev

It should. Since 1.1.* refers to the LAST STABLE VERSION of it ....