tadcka/breadcrumbs

Breadcrumbs component

v1.1.0 2014-12-17 15:04 UTC

README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads Latest Unstable Version License

Breadcrumbs component.

Installation

Step 1: Download Breadcrumbs using composer

Add TadckaAddressBundle in your composer.json:

{
    "require": {
        "tadcka/breadcrumbs": "dev-master"
    }
}

Now tell composer to download the bundle by running the command:

$ php composer.phar update tadcka/breadcrumbs

Step 2: How use?

Create breadcrumb object:

<?php
$breadcrumb = new \Tadcka\Component\Breadcrumbs\Breadcrumb();
$breadcrumb->add('acme', '/acme');
$breadcrumb->add('hello');

Render html with twig:

<ul class="breadcrumb">
    {% for item in breadcrumb %}
        <li><a href="{{ item.url is not empty ? item.url : 'javascript:;' }}">{{ item.title }}</a></li>
    {% endfor %}
</ul>