geniv/nette-breadcrumb

Breadcrumbs component for Nette Framework

v2.0.1 2018-02-26 17:06 UTC

This package is auto-updated.

Last update: 2024-11-14 04:16:16 UTC


README

Installation

$ composer require geniv/nette-breadcrumb

or

"geniv/nette-breadcrumb": ">=1.0.0"

require:

"php": ">=7.0.0",
"nette/nette": ">=2.4.0",
"geniv/nette-general-form": ">=1.0.0"

Include in application

neon configure:

services:
    - BreadCrumb

usage:

use BreadCrumb;

protected function createComponentBreadCrumb(BreadCrumb $breadCrumb): BreadCrumb
{
    // $breadcrumb->setTemplatePath(__DIR__ . '/templates/BreadCrumb.latte');
    // $breadcrumb->addLink('link', ['Homepage:'], 'icon-homepage');  // default breadcrumb
    return $breadcrumb;
}

presenters:

// add link
$this['breadCrumb']->addLink('Sub page');
// or
$this['breadCrumb']->addLink('Sub page', ['User:'])
// link with parameters
$this['breadCrumb']->addLink('Sub page', ['User:', 123, 321])
or
$this['breadCrumb']->addLink('Sub page', ['User:', 123, 321], 'fa fa-dashboard')

direct transalte title
$this['breadCrumb']->addTranslateLink('Sub page');

or update

// edit link
$this['breadCrumb']->editLink('Sub page', ['User:'], 'fa fa-dashboard')
// link with parameters
$this['breadCrumb']->editLink('Sub page', ['User:', 123, 321], 'fa fa-dashboard')
direct transalte title
$this['breadCrumb']->editTranslateLink('Sub page');

or remove

// remove
$this['breadCrumb']->removeLink('Sub page');

usage:

{control breadCrumb}