vienasbaitas / breadcrumbs
Simple package to generate breadcrumbs.
Installs: 4 294
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.4
Requires (Dev)
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2024-12-21 15:29:21 UTC
README
This package allows you to add simple and easy breadcrumb management to your project.
Installation
composer require vienasbaitas/breadcrumbs:^1.0
Usage
In order to use breadcrumbs you need to create new instance, after that just push new items to it.
$breadcrumbs = new \VienasBaitas\Breadcrumbs\Breadcrumbs(); $breadcrumbs->item('Dashboard')->path('/dashboard'); $breadcrumbs->item('Settings')->path('/settings'); $breadcrumbs->item('Blog')->path('/blog')->target(\VienasBaitas\Breadcrumbs\BreadcrumbItem::TARGET_BLANK);
After container has been initialized you can return whole breadcrumbs object to your view, alternatively you can use built-in array renderer to render it as an array.
$renderer = new \VienasBaitas\Breadcrumbs\Renderers\ArrayRenderer(); $asArray = $renderer->render($breadcrumbs);