breadcrumb classes.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am looking for a breadcrumb class in PHP that does not rely on the
directory structure to build the trail.

I have been using Richard Baskettes - / - breadcrumb classes and
they are great... BUT. I have a site that is being built using
templates and the directory hierarchy can not be used to create the

Sorry if you read this post in alt.lang.php.


Re: breadcrumb classes.

Is a class really needed for breadcrumbs? For my blog navigation (my
weblog script) I simply just use a function that goes along with my
template engine.


$output = breadcrumb("{b Index}index.php {b
Options}index.php?options", "||");

function breadcrumb($data,$sep) {
$breadcrumb = str_replace("", $sep, $data);
$breadcrumb = preg_replace("#{b (.*?)}(.*?)#s", "<a
href=\"\2\">\1</a>", $breadcrumb);
return $breadcrumb;


Will create a simple breadcrum setup, and you could just display the
navigation depending on the page load (example):

$output = breadcrumb("{b
".$_GET['id']."}index.php?id=".$_GET['id']."", "||");
Depends on how advanced you want to get.

Site Timeline