我有一个嵌套的类别结构数组,现在我需要为每个类别生成面包屑。假设我目前正在查看阿迪达斯类别页面,该页面位于品牌 - >服装 - >阿迪达斯,所以我需要像这样的面包屑品牌/服饰/阿迪达斯。
类别数组结构如下:
[1] => Array
(
[name] => 01e3f447-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 01e3f447-4b81-11e7-a858-b8763f541038
[category] => Brands
[slug] => brands
[description] =>
[image] =>
[parentCategory] =>
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 14:58:31
)
[children] => Array
(
[0] => Array
(
[name] => 0ded5b28-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 0ded5b28-4b81-11e7-a858-b8763f541038
[category] => Apparel
[slug] => apparel
[description] =>
[image] =>
[parentCategory] => 01e3f447-4b81-11e7-a858-b8763f541038
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 14:58:51
)
[children] => Array
(
[0] => Array
(
[name] => 3681265e-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 3681265e-4b81-11e7-a858-b8763f541038
[category] => Adidas
[slug] => adidas
[description] =>
[image] =>
[parentCategory] => 0ded5b28-4b81-11e7-a858-b8763f541038
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 14:59:59
)
[children] =>
)
[1] => Array
(
[name] => 3f211015-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 3f211015-4b81-11e7-a858-b8763f541038
[category] => Columbia
[slug] => columbia
[description] =>
[image] =>
[parentCategory] => 0ded5b28-4b81-11e7-a858-b8763f541038
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 15:00:14
)
[children] =>
)
)
)
[1] => Array
(
[name] => 1988d10a-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 1988d10a-4b81-11e7-a858-b8763f541038
[category] => Footwear
[slug] => footwear
[description] =>
[image] =>
[parentCategory] => 01e3f447-4b81-11e7-a858-b8763f541038
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 14:59:11
)
[children] => Array
(
[0] => Array
(
[name] => 49becbc8-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 49becbc8-4b81-11e7-a858-b8763f541038
[category] => Polo
[slug] => polo
[description] =>
[image] =>
[parentCategory] => 1988d10a-4b81-11e7-a858-b8763f541038
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 15:00:31
)
[children] =>
)
[1] => Array
(
[name] => 4e647bee-4b81-11e7-a858-b8763f541038
[nodeInfo] => stdClass Object
(
[idCategory] => 4e647bee-4b81-11e7-a858-b8763f541038
[category] => Nike
[slug] => nike
[description] =>
[image] =>
[parentCategory] => 1988d10a-4b81-11e7-a858-b8763f541038
[idStatus] => e9d3b949-1301-11e7-a9b8-b8763f541038
[date] => 2017-06-07 15:00:39
)
[children] =>
)
)
)
)
)