Hello,
This is a continuation from the following post:
http://www.sitepoint.com/forums/showthread.php?1213756-issue-creating-multiple-join-to-generate-categories-and-subcategories
Trying to generate a breadcrumb link from a array based on a user selection.
With the help from the above link i was able to pull the categories from the db and moved it into a session variable.
now that i have the array i like to be able to pull out a breadcrumb path for example
array:
index - parent - category
1 - 0 - technology
4 - 3 ------ computer
7 - 4 -------- monitor
if user clicks technology: technology
if user clicks computer: technology >> computer
if user clicks monitor: technology >> computer >> monitor.
sample out as of now:
[120] => Array
(
[rootIndex] => 3
[rootParent] => 0
[rootCategory] => technology
[category1Index] => 4
[category1Parent] => 4
[category1] => computers
[category2Index] => 14
[category2Parent] => 14
[category2] => keyboard
[category3Index] =>
[category3Parent] =>
[category3] =>
)
[121] => Array
(
[rootIndex] => 3
[rootParent] => 0
[rootCategory] => technology
[category1Index] => 4
[category1Parent] => 4
[category1] => computers
[category2Index] => 7
[category2Parent] => 7
[category2] => monitor
[category3Index] =>
[category3Parent] =>
[category3] =>
)