2017 © Pedro Peláez
 

library breadcrumb-component

Basic component rendering breadcrumb for websites using Nette Framework

image

rikiless/breadcrumb-component

Basic component rendering breadcrumb for websites using Nette Framework

  • Sunday, May 11, 2014
  • by rikiless
  • Repository
  • 1 Watchers
  • 0 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

BreadcrumbComponent

Basic component rendering breadcrumb for websites using Nette Framework., (*1)

Included template is compatible with Bootstrap 3.2 *, (*2)

Requirements

This package requires PHP 5.4., (*3)

Installation

The best way to install this package is using Composer:, (*4)

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

And register the factory in config.neon:, (*5)

services:
    - Rikiless\BreadcrumbComponent\IControl

Use

Inject to presenter:, (*6)

class Presenter ...
{

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

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

}

Render in template:, (*7)

{control breadcrumb}

Add items to breadcrumb

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:, (*8)

class Presenter ...
{

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

}

Translations

Translations are supported., (*9)

Examples

Example 1, (*10)

Example 2, (*11)

* In default template is use of classes .visible-sm mixed with .visible-lg and it seems to be broken in Bootstrap 3.1., (*12)

The Versions

11/05 2014

dev-master

9999999-dev

Basic component rendering breadcrumb for websites using Nette Framework

  Sources   Download

MIT

The Requires

 

breadcrumb nette

04/05 2014

0.9.2

0.9.2.0

Basic component rendering breadcrumb for websites using Nette Framework

  Sources   Download

MIT

The Requires

 

03/05 2014

0.9.1

0.9.1.0

Basic component rendering breadcrumb for websites using Nette Framework

  Sources   Download

MIT

The Requires

 

02/05 2014

0.9.0

0.9.0.0

Basic component rendering breadcrumb for websites using Nette Framework

  Sources   Download

MIT

The Requires