定制 kkiernan/breadcrumbs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kkiernan/breadcrumbs

Composer 安装命令:

composer require kkiernan/breadcrumbs

包简介

Easy breadcrumb generation

README 文档

README

Install

First, install the package via composer:

composer require kkiernan/breadcrumbs

If using Laravel, add the service provider and alias to config/app.php.

'providers' => [
    Kiernan\Breadcrumbs\ServiceProvider::class,
],

'aliases' => [
    'Breadcrumbs' => \Kiernan\Breadcrumbs\Facade::class,
]

Usage

Add breadcrumbs as needed before rendering your view:

Breadcrumbs::add('Posts', action('PostsController@index'));
Breadcrumbs::add('New Post');

Add many breadcrumbs at once if you prefer:

Breadcrumbs::addMany([
    ['Posts', action('PostsController@index')],
    ['New Post']
]);

A Bootstrap partial is included to display your breadcrumbs. If using Laravel Blade, you can include the partial in your template:

@include('kkiernan::breadcrumbs');

If you'd like to edit the partial, publish it to resources/views/vendor/kkiernan:

php artisan vendor:publish --tag=kkiernan

Dynamic Crumbs

Breadcrumbs can be added dynamically, which is helpful when multiple pages link to a particular page. For example, imagine that both a dashboard and a list of posts link to a post detail view. Consider the following Laravel-centric example in which the first breadcrumb will render as either "Dashboard" or "Posts" depending on the referring page.

// DashboardController@index...
Breadcrumbs::put('posts', 'Dashboard', action('DashboardController@index'));
// PostsController@index...
Breadcrumbs::put('posts', 'Posts', action('DashboardController@index'));
// PostsController@show...
Breadcrumbs::addDynamic('posts');
Breadcrumbs::add($post->title);

If you need to unset a dynamic crumb and prevent it from rendering, simply call the forget method:

Breadcrumbs::forget('posts');

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固