在laravel中的breadcrumb隐藏链接
问题描述:
I want to remove the links in breadcrumbs how do I do that? Currently using this package to do it, davejamesmiller/laravel-breadcrumbs.
Is it possible to remove the links?
For now I have something like this:
// Summary
Breadcrumbs::register('summary', function ($breadcrumbs) {
$breadcrumbs->push('List of Applicant', route('summary'));
});
// Summary > User Information
Breadcrumbs::register('user.show', function ($breadcrumbs,$id) {
$breadcrumbs->parent('summary', route('summary'));
$breadcrumbs->push('User Information', route('user.show', $id));
});
So I want to remove the link part for Summary when I am in the page of User Information, how do I do that? Example just plain text, Summary > User Information
我想删除面包屑中的链接我该怎么做? 目前使用这个包做davejamesmiller / laravel-breadcrumbs。 p>
是否可以删除链接? p>
现在我的内容如下:
//摘要
Breadcrumbs :: register('summary',function($ breadcrumbs){
$ breadcrumbs-> push('申请人列表',路线('summary'));
});
//汇总&gt ; 用户信息
Breadcrumbs :: register('user.show',function($ breadcrumbs,$ id){
$ breadcrumbs-> parent('summary',route('summary'));
$ breadcrumbs-&gt ; push('User Information',route('user.show',$ id));
});
code> pre>
所以我想删除链接 我在“用户信息”页面中的摘要部分,我该怎么做? 示例仅为纯文本,摘要> 用户信息 p>
div>
答
For push()
only mandatory param is title
, so if you want to remove URL from a breadcrumb you can do like this:
$breadcrumbs->push('User Information');