function path_breadcrumbs_path_pattern in Path Breadcrumbs 7.3
Same name and namespace in other branches
- 7.2 path_breadcrumbs.module \path_breadcrumbs_path_pattern()
Create sql pattern from url. Replaces all path arguments except the 1st one with %-symbol.
Parameters
string $path:
Return value
string pattern
1 call to path_breadcrumbs_path_pattern()
- path_breadcrumbs_load_by_path in ./
path_breadcrumbs.module - Load enabled path_breadcrumbs by path.
File
- ./
path_breadcrumbs.module, line 813
Code
function path_breadcrumbs_path_pattern($path) {
$cache =& drupal_static(__FUNCTION__);
if (empty($cache[$path])) {
// Example: 'node/%node/view' -> 'node/%/%.
$cache[$path] = preg_replace("\n /\\/ # start with slash\n [^\\/]+ # all symbols except for the slash\n /x", '/%', $path);
}
return $cache[$path];
}