06-15-2008, 05:20 PM
|
#2 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Location: On your Hard Drive, hiding like a Virus
Posts: 824
Thanks: 163
|
Quote:
Originally Posted by Aaron
Yeah... It just doesn't feel like this is the right way.
I serialize an array of the home/category/.../page breadcrumbness, and then I do this... It just doesn't seem like the right method. Any help?
PHP Code:
// Develop the breadcrumb Navigation
public function getLocation($location) {
//Unserialize the location array.
$location = unserialize($location);
$return = ' ';
foreach ($location as $url => $title) {
if ($url != 'current') {
if ($url == ROOT) {
$title = '<img src="'.ROOT.'resources/images/house_go.gif" alt="Go to the home page" />';
}
$return .= '<a href="' . $url . '">' . $title . '</a> » ';
}
else {
// Caps insensitive
if (strtolower($title) == 'home'){
return '<img src="'.ROOT.'resources/images/house.gif" alt="You are at the home page" />';
}
$return .= $title;
}
}
return $return;
}
|
First off, you haven't declared $location as an array yet, it doesn't even try to validate it as an array, which could be something wrong, plus unserialize only works on strings.
Now, breadcrumbs are just links on a navbar correct?
__________________
Wax on, Wax off
|
|
|
|