You are here

function crumbs_reduce_path in Crumbs, the Breadcrumbs suite 7.2

Same name and namespace in other branches
  1. 6.2 crumbs.trail.inc \crumbs_reduce_path()
  2. 7 crumbs.module \crumbs_reduce_path()

Chop off path fragments until we find a valid path.

Parameters

$path: Starting path or alias

$depth: Max number of fragments we try to chop off. -1 means no limit.

Return value

null|string

1 call to crumbs_reduce_path()
path_CrumbsMonoPlugin::findParent in plugins/crumbs.path.inc
Find candidates for the parent path.

File

./crumbs.module, line 144
Provides an API for building breadcrumbs.

Code

function crumbs_reduce_path($path, $depth = -1) {
  return crumbs()->router
    ->reducePath($path, $depth);
}