2017 © Pedro Peláez
 

library navigation

Nette extension - navigation for breadcrumbs

image

xruff/navigation

Nette extension - navigation for breadcrumbs

  • Thursday, June 21, 2018
  • by xruff
  • Repository
  • 3 Watchers
  • 0 Stars
  • 331 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 5 % Grown

The README.md

Breadcrumbs navigation

Original code Jan Marek., (*1)

Requirements

Package requires PHP 7.0 or higher, (*2)

Installation

The best way to install XRuff/Navigation is using Composer:, (*3)

$ composer require xruff/navigation

or add package to composer.json file, (*4)

{
    "require": {
        "xruff/navigation": "dev-master"
    }
}

Documentation

Register configuration in config.neon., (*5)

Config has two optional parameters - breadcrumbsTemplate and menuTemplate., (*6)

extensions:
    navigation: XRuff\Components\Navigation\DI\NavigationExtension

# and optional settings for custom templates
navigation:
    breadcrumbsTemplate: %appDir%/components/breadcrumbs.latte

Base presenter:, (*7)

use Nette;
use XRuff\Components\Navigation\Navigation;

abstract class BasePresenter extends Nette\Application\UI\Presenter
{
    /** @var Navigation @inject */
    public $navigationFactory;

    protected function createComponentNavigation($name) {
        $nav = $this->navigationFactory->create($this);
        $nav->setupHomepage('Homepage', $this->link('Homepage:'));
        return $nav;
    }
}

Another presenter extended from our BasePresenter:, (*8)

use XRuff\Components\Navigation\Navigation;

class SomePresenter extends BasePresenter
{
    /** @var XRuff\Components\Navigation\Navigation $nav */
    private $nav;

    protected function startup()
    {
        parent::startup();
        $this->nav = $this['navigation']->add('Company name', $this->link('Company:'));
    }

    public function renderDefault()
    {
        $this->nav = $this->nav->add('Overview', false);
        $this->nav->setCurrent(true);
    }

    public function renderDepartment()
    {
        $this->nav = $this->nav->add('Department name', false);
        $this->nav->setCurrent(true);
    }

    public function renderOther()
    {

        $sec = $this->nav->add('Section', $this->link('Category:', ['id' => 1]));
        $article = $sec->add('Article', $this->link('Article:', ['id' => 1]));
        $this->nav->setCurrentNode($article);
        // or $article->setCurrent(TRUE);
    }
}

template.latte (breadcrumbs template is compatible with Bootstrap 3):, (*9)

    ...
</head>
<body>
    {control navigation:breadcrumbs}
    ...

Repository https://github.com/XRuff/Navigation., (*10)

The Versions

21/06 2018

dev-master

9999999-dev

Nette extension - navigation for breadcrumbs

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

The Development Requires

by Pavel Lauko

component menu nette breadcrumbs

21/06 2018

v1.0.1

1.0.1.0

Nette extension - navigation for breadcrumbs

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

The Development Requires

by Pavel Lauko

component menu nette breadcrumbs

14/02 2018

v1.0.0

1.0.0.0

Nette extension - navigation for breadcrumbs

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

The Development Requires

by Pavel Lauko

component menu nette breadcrumbs