/** * Generates catalog breadcrumbs. * @param $category_id id of the category. * @param $tail an array containing elements to be apended to the breadcrumbs array. */ protected function generate_breadcrumbs($category_id, $tail = array()) { $category = new Category($category_id); $ancestors = $category->get_ancestors(); $breadcrumbs = array(); foreach ($ancestors as $ancestor) { $breadcrumbs['/show_category?id=' . $ancestor->id] = $ancestor->name; } return array_merge($breadcrumbs, $tail); }