Hi all
I am building a site where I would like to use an array to store the steps involved in making a booking into a breadcrumb trail across the top of my site. Depending on what the user is booking, the breadcrumb trail is different and of different sizes.
I want to use a method like this:
switch ($_SESSION['W_BOOKING_TYPE']) {
case 'hotels':
$_SESSION['W_BREADCRUMB'] = array('Getting Started', 'Select Hotel', 'Choose Extras', 'Comments', 'Payment');
break;
case 'cars':
$_SESSION['W_BREADCRUMB'] = array('Getting Started', 'Select Car', 'Choose Extras', 'Comments', 'Payment');
break;
case 'clothing':
$_SESSION['W_BREADCRUMB'] = array('Getting Started', 'Gender', 'Colour', 'Size', 'Type', 'Payment');
break;
}
Therefore I can loop through the array and output the values - simple! However I need to be able to store the physical URL of the breadcrumb against the name but not sure how I would do that with the array above?
i..e
Getting started links to /start
Select Hotel links to /start/hotels
Choose Extras links to /start/hotels/extras
Essentially when I loop through my array I need to pull out the name of the breadcrumb and the URL it links too, where obviously the preceding URLs within the array would be built up along the way - does that make sense?
Thanks for reading and any advice is appreciated.