You are here

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

Register a callback that will determine a title 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 322

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 routeTitleCallback($route, $key, $callback) {
  $this
    ->routeMonoPlugin($route, $key, new crumbs_MonoPlugin_TitleCallback($callback, $this->module, $key));
  $this->callbackCollection
    ->addCallback($this->module, 'routeTitle', $key, $callback);
}