Download the PHP package asprega/breadcrumb-bundle without Composer

On this page you can find all versions of the php package asprega/breadcrumb-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package breadcrumb-bundle

AndreaSpregaBreadcrumbBundle

WARNING: This bundle has been renamed and transferred to https://github.com/slope-it/breadcrumb-bundle

Latest Stable Version Total Downloads License SensioLabsInsight

This bundle provides a way to create "dynamic" breadcrumbs in your Symfony applications.

Installation

Composer is the only supported installation method. Run the following to install the latest version from Packagist:

Or, if you prefer, you can require any version in your composer.json:

NOTE: Until the bundle reaches version 1.0.0 I can't guarantee to follow semantic versioning strictly.

Usage

1. Load bundle

Once installed, load the bundle in your Kernel class:

2. Define breadcrumbs

There are two ways to create a breadcrumb: via code (1) or via annotations (2).

Via code: you can retrieve the breadcrumb builder in your controller and add breadcrumb items:

Via annotations: just use the @Breadcrumb annotation at the class and/or method level. They will be merged (class comes first).

NOTE: The annotation can take either a single item (in the above example it's done at the class level) or multiple items (at the method level).

3. Render breadcrumb

The last step is to use the following Twig function wherever you want the breadcrumb printed in your template:

Regardless of the way you used to create the breadcrumb, the result will be something like:

In which the first two items are anchors and the last one is text only.

How the breadcrumb is generated

Under the hood, this is the business logic involved, for each item, in the breadcrumb generation:

NOTE: you don't need to pass all the route parameters that are needed by route, as long as these route parameters are already present in the URL for the current request. In other words, if your breadcrumb hierarchical structure somehow "matches" your URL structure.

Example: suppose you have the following routes, with parameters and resulting URLs:

If you are in the action for route children_edit and you want to generate a breadcrumb including all the above steps, you will be able to use the following annotation:

Note how you don't have to provide the route parameters (since the current request already has them all). It would work the same if you build it via code instead.

Override breadcrumb template

The bundle default template for rendering breadcrumb can be overridden by adding the following lines to the config.yml of your application:

If you intend to do this, it's recommended to copy Resources/views/breadcrumb.html.twig to your bundle and customize it. However, in your template you'll just have to iterate over the items variable to render your custom breadcrumb.

How to contribute

Under any of these circumstances, please fork this repo and create a pull request. I am more than happy to accept contributions!

Maintainer

@andreasprega


All versions of breadcrumb-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
doctrine/annotations Version ^1.0
symfony/framework-bundle Version ^4.0|^5.0
symfony/property-access Version ^4.0|^5.0
symfony/translation-contracts Version ^1.0|^2.0
twig/twig Version ^2.10|^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package asprega/breadcrumb-bundle contains the following files

Loading the files please wait ....