mkomorowski/php-breadcrumbs

PHP breadcrumbs rendering class

dev-master 2015-07-22 19:21 UTC

This package is not auto-updated.

Last update: 2024-11-09 18:46:33 UTC


README

PHP breadcrumbs rendering class

##Installation

The package can be installed via Composer by adding to the composer.json require block.

{
    "require": {
        "mkomorowski/php-breadcrumbs": "dev-master"
    }
}

Then update application packages by running the command:

php composer.phar install

##Usage

$breadCrumbsRender = new mKomorowski\Breadcrumbs\Render;

Rendering breadcrumbs can be achieved by passing custom URI path.

echo $breadCrumbsRender->build('/library/data')

By default Render class will always prepend breadcrumbs with 'Home' crumb linking to '/' root path. To disable 'Home' crumb:

$breadCrumbsRender->disableHomeCrumb()

Edit 'Home' crumb by:

$breadcrumbsRender->setHomeCrumb("<a href='/'>Main</a>");

Passsing php null will render php $_SERVER['REQUEST_URI'] parameter

echo $breadCrumbsRender->build()