Laravel breadcrumbs bundle cannot find custom template -
i using https://github.com/davejamesmiller/laravel-breadcrumbs package.
installed says in instructions, want create custom template breadcrumbs.
i have created app/breadcrumbs.php:
breadcrumbs::register('home', function($breadcrumbs) { $breadcrumbs->push('home', route('home')); }); breadcrumbs::register('about', function($breadcrumbs) { $breadcrumbs->parent('home'); $breadcrumbs->push('about company', route('about')); });
then in config file of package:
return array( 'view' => 'laravel-breadcrumbs::_partials.breadcrumbs', );
then created view in app/views/_partials/breadcrumbs.blade.php:
@if ($breadcrumbs) <ul class="breadcrumb"> @foreach ($breadcrumbs $breadcrumb) @if (!$breadcrumb->last) <li><a href="{{{ $breadcrumb->url }}}">{{{ $breadcrumb->title }}}</a></li> @else <li class="active">{{{ $breadcrumb->title }}}</li> @endif @endforeach </ul> @endif
then printing breadcrumb in view:
{{ breadcrumbs::render('about') }}
however, getting error:
view [_partials.breadcrumbs] not found.
how cannot found if created it?!? spent 4 hours figure out thing. please. help
james helped me. had do:
return array( 'view' => '_partials.breadcrumbs', );
Comments
Post a Comment