2017 © Pedro Peláez
 

symfony-bundle breadcrumbs-bundle

Xi breadcrumbs bundle for Symfony2 that utilises routes as a tree to build the breadcrumbs in order to not pollute the controller actions with repetitive breadcrumbs code.

image

xi/breadcrumbs-bundle

Xi breadcrumbs bundle for Symfony2 that utilises routes as a tree to build the breadcrumbs in order to not pollute the controller actions with repetitive breadcrumbs code.

  • Monday, July 1, 2013
  • by peterhil
  • Repository
  • 2 Watchers
  • 11 Stars
  • 3,164 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 14 Forks
  • 10 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

xi-bundle-breadcrumbs

A Breadcrumbs bundle for Symfony2., (*1)

This is different from other breadcrumb bundles, because it utilizes routes
as a tree to build the breadcrumbs in order to not pollute the controller
actions with repetitive breadcrumbs code., (*2)

Build Status, (*3)

Design goals

  • Implement breadcrumbs with configurable and internationalised labels and urls
  • Keep it DRY: Do not repeat breadcrumbs code for the same page in several controller actions
  • Avoid using annotations either
  • Allow cyclical loops on breadcrumb hierarchy and handle it intelligently

Installing

Add bundle to composer.json

"require": {
    # ..
    "xi/breadcrumbs-bundle": ">=2.1"
    # ..
}

Add bundle to AppKernel.php

public function registerBundles()
{
    $bundles = array(
        ...

        new Xi\Bundle\BreadcrumbsBundle\XiBreadcrumbsBundle(),
    );

    ...
}

Usage

Basic usage

Add {{ xi_breadcrumbs() }} into your template and add parent and label into your route defaults.
Label is optional, and defaults to the route name., (*4)

root:
    pattern:   /
    defaults:
        label: "home"

foo:
    pattern:   /foo
    defaults:
        parent: "root"

bar:
    pattern:   /foo/bar/{slug}
    defaults:
        label: "bar {slug}"
        parent: "foo"

Parent is the name of the parent route. Label can have placeholder values between braces, as shown
below with {slug}. Note that child routes should have all the placeholders available that their parents
will use – otherwise the placeholders will be stripped from the label., (*5)

Internationalised routes

For internationalised routes using BesimpleI18nRoutingBundle, use a similar array of locales as in the locales option., (*6)

xi_service:
    locales:
        en: /service
        fi: /palvelu
    defaults:
        label:
            en: "Services"
            fi: "Palvelut"

More examples

For more usage examples, see the Yaml files at Tests/Fixtures directory., (*7)

The Versions

01/07 2013

dev-looser-deps

dev-looser-deps

Xi breadcrumbs bundle for Symfony2 that utilises routes as a tree to build the breadcrumbs in order to not pollute the controller actions with repetitive breadcrumbs code.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Avatar xi-project

routing breadcrumbs internationalisation xi

01/07 2013

2.3.x-dev

2.3.9999999.9999999-dev

Xi breadcrumbs bundle for Symfony2 that utilises routes as a tree to build the breadcrumbs in order to not pollute the controller actions with repetitive breadcrumbs code.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Avatar xi-project

routing breadcrumbs internationalisation xi

23/04 2013

dev-master

9999999-dev

Xi breadcrumbs bundle for Symfony2 that utilises routes as a tree to build the breadcrumbs in order to not pollute the controller actions with repetitive breadcrumbs code.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Avatar xi-project

routing breadcrumbs internationalisation xi

10/10 2012

2.1.x-dev

2.1.9999999.9999999-dev

Xi breadcrumbs bundle for Symfony2 that utilises routes as a tree to build the breadcrumbs in order to not pollute the controller actions with repetitive breadcrumbs code.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Avatar xi-project

routing breadcrumbs internationalisation xi

10/10 2012

dev-get-uri-fix-sf21

dev-get-uri-fix-sf21

Xi breadcrumbs bundle for Symfony2 that utilises routes as a tree to build the breadcrumbs in order to not pollute the controller actions with repetitive breadcrumbs code.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Avatar xi-project

routing breadcrumbs internationalisation xi

10/10 2012

2.0.x-dev

2.0.9999999.9999999-dev

Xi breadcrumbs bundle for Symfony2 that utilises routes as a tree to build the breadcrumbs in order to not pollute the controller actions with repetitive breadcrumbs code.

  Sources   Download

BSD

The Requires

 

The Development Requires

by Avatar xi-project

routing breadcrumbs internationalisation xi

10/10 2012

dev-get-uri-fix

dev-get-uri-fix

Xi breadcrumbs bundle for Symfony2 that utilises routes as a tree to build the breadcrumbs in order to not pollute the controller actions with repetitive breadcrumbs code.

  Sources   Download

BSD

The Requires

 

The Development Requires

by Avatar xi-project

routing breadcrumbs internationalisation xi