sasule / breadcrumb
Breadcrumbs component for Nette Framework
v1.1.0
2023-10-06 10:53 UTC
Requires
- php: ^8.0
- latte/latte: ^3.0
- nette/application: ^3.0
- nette/di: ^3.0
README
Breadcrumbs component for Nette Framework (2.x and 3.x branch)
Inspired by Geniv/nette-breadcrumb
Installation
$ composer require sasule/breadcrumb
Usage
First activate extension in your config.neon or common.neon (based on version of Nette framework)
extensions: breadcrumb: Sasule\Breadcrumb\DI\BreadcrumbExtension
Then inject into your presenter and create component:
/** * @var Sasule\Breadcrumb\Breadcrumb */ private $breadcrumb; /** * @param Sasule\Breadcrumb\Breadcrumb $breadcrumb */ public function injectBreadcrumb(Sasule\Breadcrumb\Breadcrumb $breadcrumb) { $this->breadcrumb = $breadcrumb; } ... /** * @return Sasule\Breadcrumb\Breadcrumb */ protected function createComponentBreadcrumb() { $bc = $this->breadcrumb; //$bc->addLink('Domů', ':Default:Homepage:default'); //You can add default links so this will be shown everytime (if uncommented). return $bc; }
Then in your template:
{control breadcrumb}
...and you are done.