I'm new to Symfony2 and I just installed it along with fosUserBUndle 1.3.3, Sonata Admin BUndle, and Sonata User BUndle. Now I get an error that I cannot resolve.
Here is my error:
(url localhost:8000/profile/ ) :
Method "currentAncestor" for object "Knp\Menu\MenuItem" does not exist in
SonataBlockBundle:Block:block_side_menu_template.html.twig at line 29
I am able to login succesfully, but I get this error after login. Any help would be greatly appreciated.
Thanks
open file block_side_menu_template.html.twig at /var/www/html/MySymProject/vendor/sonata-project/block-bundle/Resources/views/Block/block_side_menu_template.html.twig
look at line 22 :
{%- if item.current %}
{%- set classes = classes|merge([options.currentClass]) %}
{%- elseif item.currentAncestor %}
{%- set classes = classes|merge([options.ancestorClass]) %}
{%- endif %}
Edit to :
{%- if matcher.isCurrent(item) %}
{%- set classes = classes|merge([options.currentClass]) %}
{%- elseif matcher.isAncestor(item, options.depth) %}
{%- set classes = classes|merge([options.ancestorClass]) %}
{%- endif %}
you can visit this link below to find the answer :
https://gist.github.com/mrflory/2278437#file-knp_menu-html-twig-L22
来源:https://stackoverflow.com/questions/25793518/method-currentancestor-for-object-knp-menu-menuitem-does-not-exist-in-sonata