GithubHelp home page GithubHelp logo

breadcrumbsbundle's Introduction

Installation

  1. Add this bundle to your vendor/ dir using the vendors script:
Add the following lines in your ``deps`` file:

    [WhiteOctoberBreadcrumbsBundle]
        git=git://github.com/whiteoctober/BreadcrumbsBundle.git
        target=/bundles/WhiteOctober/BreadcrumbsBundle

**Or** add the following to your composer.json:

	"whiteoctober/breadcrumbs-bundle": "master"

Run the vendors script:

    ./bin/vendors install
  1. Add the WhiteOctober namespace to your autoloader:

    // app/autoload.php $loader->registerNamespaces(array( 'WhiteOctober' => DIR.'/../vendor/bundles', ));

  2. Add this bundle to your application's kernel:

    // app/AppKernel.php public function registerBundles() { return array( // ... new WhiteOctober\BreadcrumbsBundle\WhiteOctoberBreadcrumbsBundle(), // ... ); }

  3. Configure the white_october_breadcrumbs service in your config.yml:

    white_october_breadcrumbs: ~

That's it for configuration.

Usage

In your application controller methods:

public function yourAction()
{
    $breadcrumbs = $this->get("white_october_breadcrumbs");
    $breadcrumbs->addItem("Home", $this->get("router")->generate("index"));
    $breadcrumbs->addItem("Register", $this->get("router")->generate("register"));
}

and then in your template:

{{ wo_render_breadcrumbs() }}

The last item in the breadcrumbs collection will automatically be rendered as plain text rather than a <a>...</a> tag.

Overriding the template

You can override the template used by copying the Resources/views/breadcrumbs.html.twig file out of the bundle and placing it into app/Resources/WhiteOctoberBreadcrumbsBundle/views, then customising as you see fit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.