PHP code example of geniv / nette-breadcrumb

1. Go to this page and download the library: Download geniv/nette-breadcrumb library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

geniv / nette-breadcrumb example snippets


use BreadCrumb;

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

// 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');

// 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');

// remove
$this['breadCrumb']->removeLink('Sub page');
json
"php": ">=7.0.0",
"nette/nette": ">=2.4.0",
"geniv/nette-general-form": ">=1.0.0"