Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ngatngay/nette-breadcrumb
https://github.com/ngatngay/nette-breadcrumb
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ngatngay/nette-breadcrumb
- Owner: ngatngay
- License: mit
- Created: 2021-10-01T06:46:34.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-01T07:43:56.000Z (over 3 years ago)
- Last Synced: 2024-11-24T23:59:51.902Z (about 2 months ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Nette Breadcrumb
===========================================Simple [Nette](http://nette.org) component creating Breadcrumb navigation.
Installation
------------```sh
composer require ngatngay/nette-breadcrumb:dev-master
```Using
-----
Create component in your presenter (idelly in BasePresenter) and add link to the main page```php
protected function createComponentBreadCrumb()
{
$breadCrumb = new \NgatNgay\NetteBreadCrumb\BreadCrumb();
$breadCrumb->addLink('Main page', $this->link('Homepage:'));return $breadCrumb;
}
```In another presenter, when we want to add another link -
```php
$this['breadCrumb']->addLink('Sub page')
```
to edit this link on any presenter's action you could use the next```php
$this['breadCrumb']->editLink('Sub page', $this->link('User:'))
```and to remove
```php
$this['breadCrumb']->removeLink('Sub page')
```Calling it from templates
```php
{control breadCrumb}
```
finally if you have your own template you can call with customTemplate($template) on the presenter class, by example```php
// on your component declaration (maybe called BasePresenter.php)
$breadCrumb->customTemplate($this->context->getParameters()['appDir'].'/templates/@BreadCrumb.latte');// or on your regular presenter
$this['breadCrumb']->customTemplate($this->context->getParameters()['appDir'].'/templates/@BreadCrumb.latte');
```