<commit_before>BreadcrumbComponent
===

Basic component rendering breadcrumb for websites using Nette Framework.

Included template is compatible with Bootstrap 3.2 *

Requirements
---

This package requires PHP 5.4.

- [nette/application](https://github.com/nette/application/)

Installation
---

The best way to install this package is using [Composer](https://getcomposer.org):

```sh
$ composer require "rikiless/breadcrumb-component:@dev"
```

And register the factory in ``config.neon``:

```neon
services:
    - Rikiless\BreadcrumbComponent\IControl
```

Use
---

Inject to presenter:

```php
class Presenter ... {

    /**
     * @var Rikiless\BreadcrumbComponent\IControl
     * @inject
     */
    public $breadcrumbControl;

    public function createComponentBreadcrumb()
    {
        return $this->breadcrumbControl->create();
    }

}
```

Render in template:

```latte
{control breadcrumb}
```

### Add items to breadcrumb

```php
class CatalogPresenter ... {

    public function actionEpisode($id)
    {
        //$episode = ...($id);

		$this['breadcrumb']
			->add('Series', $this->link('Homepage:genres'))
			->add($episode->show->name, $this->link('Homepage:show', $episode->show->url))
			->add('All episodes', $this->link('Homepage:episodes', $episode->show->url))
			->add($episode->show->name);
    }

}
```

Rendered examples:

![Example 1](http://github.rikiho.net/breadcrumb-component-1.png)<commit_msg>update docs<commit_after>BreadcrumbComponent
===

Basic component rendering breadcrumb for websites using Nette Framework.

*Included template is compatible with Bootstrap 3.2 \**

Requirements
---

This package requires PHP 5.4.

- [nette/application](https://github.com/nette/application/)

Installation
---

The best way to install this package is using [Composer](https://getcomposer.org):

```sh
$ composer require "rikiless/breadcrumb-component:@dev"
```

And register the factory in ``config.neon``:

```neon
services:
    - Rikiless\BreadcrumbComponent\IControl
```

Use
---

Inject to presenter:

```php
class Presenter ...
{

    /**
     * @var Rikiless\BreadcrumbComponent\IControl
     * @inject
     */
    public $breadcrumbControl;

    public function createComponentBreadcrumb()
    {
        return $this->breadcrumbControl->create();
    }

}
```

Render in template:

```latte
{control breadcrumb}
```

### Add items to breadcrumb

```php
class CatalogPresenter ...
{

    public function actionEpisode($id)
    {
        //$episode = ...($id);

		$this['breadcrumb']
			->add('Series', $this->link('Homepage:genres'))
			->add($episode->show->name, $this->link('Homepage:show', $episode->show->url))
			->add('All episodes', $this->link('Homepage:episodes', $episode->show->url))
			->add($episode->show->name);
    }

}
```

### Custom template

You can use your own template by this way:
```php
class Presenter ...
{

    public function createComponentBreadcrumb()
    {
        $breadcrumb = $this->breadcrumbControl->create();
        $breadcrumb->setTemplate(__DIR__. '/../templates/_breadcrumb.latte');
        return $breadcrumb;
    }

}
```

### Translations

Translations are supported.

Examples
---

![Example 1](http://github.rikiho.net/breadcrumb-component-1.png)
{'fraction_non_alphanumeric': 0.16367574257425743, 'fraction_numerical': 0.0037128712871287127, 'mean_word_length': 3.6054131054131053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 40, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4344515', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1044, 'n_words': 222}