\Menu\View\HelperBreadcrumbHelper

BreadcrumbHelper.

For rendering HTML breadcrumbs.

Summary

Methods
Properties
Constants
__call()
render()
renderIfNotEmpty()
trigger()
eventDispatcher()
triggered()
$helpers
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$helpers

$helpers : array

Helpers used by this helper class.

Type

array

Methods

__call()

__call(string $method, array $args) : mixed

Method delegation.

We try to dispatch unexisting method to \Menu\View\BreadcrumbRegistry class.

Parameters

string $method

Name of the method to be invoked

array $args

List of arguments passed to the function

Throws

\Cake\Core\Exception\Exception

When the method is unknown

Returns

mixed

render()

render(array $options) : string

Renders a breadcrumb menu list.

This methods renders an <ol> HTML menu using MenuHelper class, check this class for more information about valid options.

Parameters

array $options

Array of options for MenuHelper::render() method

Returns

string —

HTML

renderIfNotEmpty()

renderIfNotEmpty(array $options) : string

Renders the breadcrumb if there at least one crumb.

Simplifies the following situation:

if ($this->Breadcrumb->count()) {
    echo $this->Breadcrumb->render();
}

Usage:

echo $this->Breadcrumb->renderIfNotEmpty();

Parameters

array $options

Array of options for render() method

Returns

string —

HTML code, or an empty string if no crumbs are found

trigger()

trigger(array|string $eventName) : \Cake\Event\Event

Triggers the given event name. This method provides a shortcut for:

$this->trigger('EventName', $arg1, $arg2, ..., $argn);

You can provide a subject to use by passing an array as first arguments where the first element is the event name and the second one is the subject, if no subject is given $this will be used by default:

$this->trigger(['GetTime', new MySubject()], $arg_0, $arg_1, ..., $arg_n);

You can also indicate an EventDispatcher instance to use by prefixing the event name with <InstanceName>::, for instance:

$this->trigger('Blog::EventName', $arg1, $arg2, ..., $argn);

This will use the EventDispacher instance named Blog and will trigger the event EventName within that instance.

Parameters

array|string $eventName

The event name to trigger

Returns

\Cake\Event\Event —

The event object that was fired

eventDispatcher()

eventDispatcher(string $name) : \QuickApps\Event\EventDispatcher

Gets an instance of the given Event Dispatcher name.

Usage:

$this->eventDispatcher('myDispatcher')
    ->trigger('MyEventName', $argument)
    ->result;

Parameters

string $name

Name of the dispatcher to get, defaults to 'default'

Returns

\QuickApps\Event\EventDispatcher

triggered()

triggered(string|null $eventName) : integer|array

Retrieves the number of times an event was triggered, or the complete list of events that were triggered.

Parameters

string|null $eventName

The name of the event, if null returns the entire list of event that were fired

Returns

integer|array