sukohi / bakery
There is no license information available for the latest version (2.0.0) of this package.
A PHP package mainly developed for Laravel to generate breadcrumbs using routes.
2.0.0
2015-08-16 00:08 UTC
Requires
- laravel/framework: ~5.0
This package is not auto-updated.
Last update: 2024-12-21 17:27:50 UTC
README
A PHP package mainly developed for Laravel to generate breadcrumbs using routes.
(This is for Laravel 4.2. For Laravel 5+)
Installation
Add this package name in composer.json
"require": {
"sukohi/bakery": "2.*"
}
Execute composer command.
composer update
Register the service provider in app.php
'providers' => [
...Others...,
Sukohi\Bakery\BakeryServiceProvider::class,
]
Also alias
'aliases' => [
...Others...,
'Bakery' => Sukohi\Bakery\Facades\Bakery::class
]
Usage
$params = [
'home' => 'Home',
'home.area:vancouver' => 'Vancouver',
'home.food:sushi,popular' => 'Popular sushi restaurants',
'*' => 'Samurai'
];
foreach(\Bakery::get($params) as $bakery) {
if($bakery->isCurrent) {
echo $bakery->title;
} else {
echo link_to($bakery->url, $bakery->title) .' > ';
}
}
About parameter pattern
- 'route' => 'title'
- 'route:parameter' => 'title'
- 'route:parameter1,parameter2' => 'title',
- '*' => 'Current Page'
License
This package is licensed under the MIT License.
Copyright 2014 Sukohi Kuhoh