我正在尝试从数组创建动态面包屑。所以我可以添加到数组中,而不必手动更新面包屑。
好的,这是我的数组的一个片段:(不会更深入)
$menu = array(
'Dashboard' => array(
'Projects' => array(
'Project 1' => array(
'Project settings' => 'projects/project_1/settings',
'Issue Tracker' => 'projects/project_1/issue_tracker',
'Customize page' => 'projects/project_1',
'Manage files' => 'projects/project_1/files',
),
'Project 2' => array(
'Project settings' => 'projects/project_2/settings',
'Issue Tracker' => 'projects/project_2/issue_tracker',
'Customize page' => 'projects/project_2',
'Manage files' => 'projects/project_2/files',
),
),
'Logout' => '#',
)
);
我希望能够以以后可以迭代的方式返回任何键的所有父项。例如,对于“项目设置”:
'Dashboard','Projects','Project 1'.