Method “currentAncestor” for object “Knp\\Menu\\MenuItem” does not exist in Sonata

匆匆过客 提交于 2019-12-04 17:29:57

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!