public function index() { $breadcrumbs = new \Creitive\Breadcrumbs\Breadcrumbs(); $breadcrumbs->addCrumb('Home', '/'); $breadcrumbs->addCrumb('Pages', 'pages'); $breadcrumbs->addCrumb('Subpage', 'subpage'); $breadcrumbs->addCrumb('Subsubpage', '/subsubpage'); $breadcrumbs->addCrumb('Other website', 'http://otherwebsite.com/some-page'); $miga = $breadcrumbs->render(); $registros = Registro::all(); return view('registros.index', array('registros' => $registros, 'breadcrumbs' => $miga)); }
function kalCrumbs($uri) { $breadcrumbs = new Creitive\Breadcrumbs\Breadcrumbs(); $breadcrumbs->addCrumb('Heim', '/'); $breadcrumbs->setDivider(''); $breadcrumbs->setCssClasses('kal-crumbs'); $parts = array_filter(explode("/", $uri)); foreach ($parts as $part) { foreach (config('formable.hlutir') as $hlutur) { $class = "\\App\\" . ucfirst($hlutur); $m = new $class(); $item = $m->where('slug', $part)->first(); if (!$item) { continue; } $breadcrumbs->addCrumb($item->title, $item->slug); } } echo $breadcrumbs->render(); }
function kalCrumbs() { $breadcrumbs = new Creitive\Breadcrumbs\Breadcrumbs(); $breadcrumbs->addCrumb('<i class="uk-icon-home uk-margin-right"></i>Heim', '/'); $breadcrumbs->setDivider(''); $breadcrumbs->setCssClasses('kal-crumbs uk-margin-top'); $parts = array_filter(explode("/", \Request::path())); foreach ($parts as $part) { foreach (config('formable.hlutir') as $hlutur) { $class = "\\App\\" . ucfirst($hlutur); $m = new $class(); $item = $m->where('slug', $part)->first(); if (!$item) { continue; } $breadcrumbs->addCrumb($item->title, $item->slug); } } if (\Request::is('veftre')) { $breadcrumbs->addCrumb('Veftré', 'veftre'); } if (\Request::is('karfa') || \Request::is('cart')) { $breadcrumbs->addCrumb('Karfa', 'karfa'); } if (\Request::is('checkout') || \Request::is('pontun')) { $breadcrumbs->addCrumb('Karfa', 'karfa'); $breadcrumbs->addCrumb('Pöntun', 'checkout'); } echo $breadcrumbs->render(); }