isicsBreadcrumbsPlugin - 0.9.0

A simple way to handle breadcrumbs.

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source | Show as Markdown

isicsBreadcrumbsPlugin plugin

The isicsBreadcrumbsPlugin is a simple way to handle breadcrumbs in your applications.

Note : this plugin hasn't be tested in Symfony 1.1.

At a glance

  • A singleton who manages breadcrumbsItems. By default, a root item is present (text: Home, uri: @homepage)
  • A component who display the breadcrumbs

License

The isicsBreadcrumbsPlugin is licensed under the GNU Lesser General Public License (LGPL).

Installation

  • Install the plugin:

    $ symfony plugin-install http://plugins.symfony-project.com/isicsBreadcrumbsPlugin $ symfony cc

  • Enable the module isicsBreadcrumbs in settings.yml:

    all: .settings: enabled_modules: isicsBreadcrumbsPlugin

Usage

Define the path in your actions:

public function executeMyAction()
{
  isicsBreadcrumbs::getInstance()->addItem('My action', 'myModule/myAction');
 
  => Home > My action

If the action is more deep:

public function executeMyAction()
{
  isicsBreadcrumbs::getInstance()->addItem('My previous action', 'myModule/myPreviousAction');
  isicsBreadcrumbs::getInstance()->addItem('My action', 'myModule/myAction');
 
  => Home > My previous action > My action

Include the breadcrumbs component (in the layout for instance):

 

You can set your own root:

 

API

  • void addItem(String $test, String $uri): add an item at the end of the breadcrumbs
  • void clearItems(): erase all items
  • isicsBreadcrumbs getInstance(): retrieve the singleton instance
  • array getItems(): return an array of isicsBreadcrumbsItem
  • void setRoot(String $test, String $uri): set root item. By default, a root item is already present (text: Home, uri: @homepage).

2008-06-23 | 0.9.0 beta

  • Initial public release.