2017 © Pedro Peláez
 

library breadcrumb-builder

Easily build breadcrumbs

image

vdhicts/breadcrumb-builder

Easily build breadcrumbs

  • Friday, May 4, 2018
  • by vdhicts
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Breadcrumb

This package allows you to easily build a breadcrumb from PHP., (*1)

Requirements

This package requires PHP 7 and the renderers make use of vdhicts/html-element., (*2)

Installation

This package can be used in any PHP project or with any framework., (*3)

You can install the package via composer:, (*4)

``` bash composer require vdhicts/breadcrumb-builder, (*5)


## Usage ```php use Vdhicts\Dicms\Breadcrumb; // Create breadcrumb items $applicationItem = new Breadcrumb\Item('Application', null, 'bars'); // without link, with icon $pageItem = new Breadcrumb\Item('Page', 'http://www.example.com/page'); // with link, without icon $actionItem = new Breadcrumb\Item('Add', 'http://www.example.com/page/add', 'plus'); // with link, with icon // Start the item collection $itemCollection = new Breadcrumb\ItemCollection(); // Add multiple items at once $itemCollection->setItems([ $applicationItem, $pageItem ]); // Add a single item $itemCollection->addItem($actionItem); // Boot the renderer $renderer = new Breadcrumb\Renderers\Bootstrap3(); // Boot the builder with the collection and renderer $builder = new Breadcrumb\Builder($itemCollection, $renderer); // Generate the breadcrumb $builder->generate();

Renderers

There are 2 renderers available by default, for Bootstrap 3 and Bootstrap 4:, (*6)

Bootstrap 3

<ol class="breadcrumb">
    <li>
        <i class="fa fa-fw fa-bars"></i> Application
    </li>
    <li>
        <a href="http://www.example.com/page">Page</a>
    </li>
    <li class="active">
        <a href="http://www.example.com/page/add"><i class="fa fa-fw fa-plus"></i> Add</a>
    </li>
</ol>

Bootstrap 4

<ol class="breadcrumb">
    <li class="breadcrumb-item">
        <i class="fa fa-fw fa-bars"></i> Application
    </li>
    <li class="breadcrumb-item">
        <a href="http://www.example.com/page">Page</a>
    </li>
    <li class="breadcrumb-item active">
        <a href="http://www.example.com/page/add"><i class="fa fa-fw fa-plus"></i> Add</a>
    </li>
</ol>

Custom renderer

You can use your own renderer as long as it implements the Renderer interface., (*7)

Tests

Full code coverage unit tests are available in the tests folder. Run via phpunit:, (*8)

vendor\bin\phpunit, (*9)

By default a coverage report will be generated in the build/coverage folder., (*10)

Contribution

Any contribution is welcome, but it should be fully tested, meet the PSR-2 standard and please create one pull request per feature. In exchange you will be credited as contributor on this page., (*11)

Security

If you discover any security related issues in this or other packages of Vdhicts, please email info@vdhicts.nl instead of using the issue tracker., (*12)

License

This package is open-sourced software licensed under the MIT license., (*13)

About vdhicts

Van der Heiden ICT services is the name of my personal company for which I work as freelancer. Van der Heiden ICT services develops and implements IT solutions for businesses and educational institutions., (*14)

The Versions

04/05 2018

dev-feature/update-namespace

dev-feature/update-namespace

Easily build breadcrumbs

  Sources   Download

MIT

The Requires

 

The Development Requires

04/05 2018

dev-master

9999999-dev

Easily build breadcrumbs

  Sources   Download

MIT

The Requires

 

The Development Requires

04/05 2018

2.0.0

2.0.0.0

Easily build breadcrumbs

  Sources   Download

MIT

The Requires

 

The Development Requires

16/10 2017

1.0.0

1.0.0.0

Easily build breadcrumbs

  Sources   Download

MIT

The Requires

 

The Development Requires