Package Data | |
---|---|
Maintainer Username: | hoaaah |
Maintainer Contact: | heru@belajararief.com (Heru Arief Wijaya) |
Package Create Date: | 2017-06-15 |
Package Last Update: | 2021-07-05 |
Home Page: | https://belajararief.com |
Language: | PHP |
License: | Unknown |
Last Refreshed: | 2025-02-05 03:16:30 |
Package Statistics | |
---|---|
Total Downloads: | 1,260 |
Monthly Downloads: | 6 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
The preferred way to install this extension is through composer.
Either run
composer require hoaaah/laravel-bootstrap-breadcrumb:dev-master
or add
"hoaaah/laravel-bootstrap-breadcrumb": "dev-master"
to the require section of your composer.json
file.
You can use this helper in your view. It also support blade template.
This helper consist of this following code.
use hoaaah\LaravelBreadcrumb\Breadcrumb as Breadcrumb;
// ..........
$breadcrumb = new Breadcrumb(); // class
$breadcrumb->begin(); //required to begin breadcrumb
//your breadcrumb ---------------------------
$breadcrumb->end(); //required to end breadcrumb
This helper use url('\')
as default home Url. You can change your home url with homeUrl
method. The following code as an example.
$breadcrum = new Breadcrumb();
$breadcrumb->homeUrl = 'home'; // Use this if you want costum homeUrl, default to url('/');
$breadcrumb->begin();
//.....................
$breadcrumb->end();
You can use method add
to add your breadcrumb. This method have two parameter,
label
is a string. This param use for label of your breadcrumb. This param is required for add breadcrumbThe following code are complete example of breadcrumb item
use hoaaah\LaravelBreadcrumb\Breadcrumb as Breadcrumb;
$breadcrumb = new Breadcrumb();
$breadcrumb->begin();
$breadcrumb->add(['label' => 'Link 1']);
$breadcrumb->add(['url' => '/link2', 'label' => 'Link 2']);
$breadcrumb->add(['label' => $this->title]);
$breadcrumb->end();