2017 © Pedro PelĂĄez
 

symfony-bundle breadcrumb-bundle

The CnertaBreadcrumbBundle, for Symfony2, provide an easy way to create a breadcrumb with KnpMenuBundle

image

cnerta/breadcrumb-bundle

The CnertaBreadcrumbBundle, for Symfony2, provide an easy way to create a breadcrumb with KnpMenuBundle

  • Wednesday, October 21, 2015
  • by waldo2188
  • Repository
  • 1 Watchers
  • 18 Stars
  • 88,507 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 5 Forks
  • 2 Open issues
  • 8 Versions
  • 4 % Grown

The README.md

/!\ Repository not maintained and outdated /!\

CnertaBreadcrumbBundle

The CnertaBreadcrumbBundle provide an easy way to create a breadcrumb with KnpMenuBundle for Symfony2., (*1)

If you want to take a look, this Symfony2 app is my Sandbox, DemoMenu., (*2)

SensioLabsInsight, (*3)

Build Status Latest Stable Version Latest Unstable Version, (*4)

Install the Bundle

  1. Add the sources in your composer.json
     "require": {
        // ...
        "cnerta/breadcrumb-bundle": "2.1.*"
    }
  1. Then add it to your AppKernel class::
    // in AppKernel::registerBundles()
    $bundles = array(
        // ...
        new Cnerta\BreadcrumbBundle\CnertaBreadcrumbBundle(),
        // ...
    );

Default configuration

You don't have to configure anything. This part is only usefull if you want to setup a default breadcrumb template., (*5)

config.yml, (*6)


cnerta_breadcrumb: twig: template: CnertaBreadcrumbBundle::cnerta_breadcrumb.html.twig

Rendering Breadcrumb

First create your menu with the KnpMenuBundle., (*7)

Next, in your twig template call :, (*8)

    {{ cnerta_breadcrumb_render('MyWonderfullBundle:Builder:Menu') }}

Or if you just want to get the breadcrumb array and make your stuff :, (*9)

    {% set currentItem = cnerta_breadcrumb_get('MyWonderfullBundle:Builder:Menu') %}
    {# some crazy stuff #}
    {% for item in currentItem %}
        {% if loop.index != 1 %}
            {% if loop.index > 1 %} > {% endif %}
            {% if not loop.last %}<a href="{{ item.uri }}">{{ item.label }}</a>
            {% else %}<span>{{ item.label }}</span>{% endif %}
        {% endif %}
    {% endfor %}

If you want to use your own template for rendering :, (*10)

    {{ cnerta_breadcrumb_render('MyWonderfullBundle:Builder:Menu', {'template': 'MyWonderfullBundle:Breadcrumb:myBreadcrumb.html.twig'}) }}

Unit test the Bundle

Before running phpunit you must load dependencies. This will only load the required vendors needed for run test., (*11)

     composer install --dev

After that you can run phpunit., (*12)

      ./vendor/bin/phpunit -c phpunit.xml.dist

Changelog

Version 2.1.0 (2015/10/19)

  • #4 Remove an unnecessary function who remove a node labeled "root"

The Versions

21/10 2015

dev-master

9999999-dev

The CnertaBreadcrumbBundle, for Symfony2, provide an easy way to create a breadcrumb with KnpMenuBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony2 breadcrumbs knpmenu

21/10 2015

2.0.3

2.0.3.0

The CnertaBreadcrumbBundle, for Symfony2, provide an easy way to create a breadcrumb with KnpMenuBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony2 breadcrumbs knpmenu

21/10 2015

2.1.1

2.1.1.0

The CnertaBreadcrumbBundle, for Symfony2, provide an easy way to create a breadcrumb with KnpMenuBundle

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony2 breadcrumbs knpmenu

19/10 2015

2.1.0

2.1.0.0

This bundle provides a breadcrumb for the KnpMenu library

  Sources   Download

MIT

The Requires

 

The Development Requires

menu

10/09 2015

2.0.2

2.0.2.0

This bundle provides a breadcrumb for the KnpMenu library

  Sources   Download

MIT

The Requires

 

The Development Requires

menu

26/08 2014

2.0.1

2.0.1.0

This bundle provides a breadcrumb for the KnpMenu library

  Sources   Download

MIT

The Requires

 

menu

07/05 2014

2.0.0

2.0.0.0

This bundle provides a breadcrumb for the KnpMenu library

  Sources   Download

MIT

The Requires

 

menu

13/11 2013

1.0.0

1.0.0.0

This bundle provides a breadcrumb for the KnpMenu library

  Sources   Download

MIT

The Requires

 

menu