【发布时间】:2020-03-06 15:43:48
【问题描述】:
My phtml file。 block file code。 all menu category data.output when I show data without using recursion upto two child category levels. output when I try to use recursion to show all child categories
实际上我需要在 magento 2 中创建超级菜单。所以我在模块块文件中使用集合获得导航类别数据,然后在模块 phtml 上。 现在我想使用 recusive foreach 循环显示导航类别标签名称。但它不起作用。当我不使用递归时,它会显示, 但是当我使用递归函数或数组函数数组行走时,它不起作用。我需要使用递归,以便它显示所有子类别的标签名称。 请帮忙。 我已经添加了我的块文件代码、Phtml 文件和模块前端输出的图像,请帮助。为什么递归不起作用?
【问题讨论】: