You are here

function crumbs_InjectedAPI_hookCrumbsPlugins::routeParentCallback in Crumbs, the Breadcrumbs suite 7.2

Register a callback that will determine a parent for a breadcrumb item.

Parameters

string $route: The route where this callback should be used, e.g. "node/%".

string $key: The plugin key under which this callback will be listed on the weights configuration form.

callback $callback: The callback, e.g. an anonymous function. The signature must be $callback(string $path, array $item), like the findParent() method of a typical crumbs_MonoPlugin.

File

lib/InjectedAPI/hookCrumbsPlugins.php, line 295

Class

crumbs_InjectedAPI_hookCrumbsPlugins
API object to be used as an argument for hook_crumbs_plugins() This is a sandbox class, currently not used..

Code

function routeParentCallback($route, $key, $callback) {
  $this
    ->routeMonoPlugin($route, $key, new crumbs_MonoPlugin_ParentPathCallback($callback, $this->module, $key));
  $this->callbackCollection
    ->addCallback($this->module, 'routeParent', $key, $callback);
}