Download the PHP package nymo/silex-twig-breadcrumb-extension without Composer

On this page you can find all versions of the php package nymo/silex-twig-breadcrumb-extension. 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 silex-twig-breadcrumb-extension

Twig breadcrumb extension for Silex

This is a breadcrumb extension for Twig which includes a breadcrumb service provider for silex for easy and simple use of breadcrumbs in Silex.

Packagist Monthly Downloads Build Status Coverage Status

New in Version 3.0

General Features

General Requirements

For PHP 5.3

For PHP 5.6

For PHP > 7.1

Installation

PHP Configuration

Please make sure that gettext functionality is activated in your PHP environment. For further assistance please refer to the official PHP Manual http://www.php.net

Via composer:

First add the following to your composer.json file

Use Version 2.x for Silex 2 with PHP <= 5.6.

Silex 1.x

Then run composer update.

Configure Silex

I assume you have already a running Silex application with Twig as a template engine. First register the breadcrumb service provider:

Then register the Twig breadcrumb extension. You have to define this after your registered the Twig service provider otherwise the application throws an error if you use $app['twig'].

Silex 1.x

That's all. Now you ready to go.

Usage

After your successfull installation you can add breadcrumb items wherever you want. All you need is to call the breadcrumb service and add a item:

New style

The last item in your container is always printed as plain text without an tag. You can also add an breadcrumb item without any url. Then this breadcrumb item will also be printed as plain text.

Old style deprecated

The last item in your container is always printed as plain text without an tag. You can also add an breadcrumb item without any url. Then this breadcrumb item will also be printed as plain text.

Named Routes

You can also use named routes. This extension supports two types of named routes a simple and a complex one with parameters. Before you start to add a named route you will have to register (if not done already) the Silex UrlGeneratorServiceProvider.

Then add this url generator to the breadcrumbs collection.

Now you're ready to go.

Simple named route

If you got a simple route without any required parameters you can add this route to the breadcrumb collection as follows:

New style

Old style deprecated

Complex named route

A complex named route is being added the same way as a simple named route. What needs to be done additionally is to pass an array with the required parameters as a second value to the array.

New style

Old style deprecated

Rendering breadcrumbs in twig

In your Twig template you can render your breadcrumbs with this function:

The default template renders an unordered list. The last item has a css class called lastItem. You can override this template. Just copy the breadcrumbs.html.twig template from the vendor folder into your view path.

i18n Support

Since version 1.1.0 this extension supports i18n. Each linkname has an optional translation filter which is only activated if you use the Translation Service Provider. For further information please refer to the Silex Documentation.

Optional configuration

The extension comes with a small configuration option which can be used optional. The default separator used for for the breadcrumbs is a > sign. If you want to change it you can pass your own separator when registering the Twig extension:


All versions of silex-twig-breadcrumb-extension with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
silex/silex Version ^2.0
twig/twig Version ^2.0
symfony/twig-bridge Version ^4.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 nymo/silex-twig-breadcrumb-extension contains the following files

Loading the files please wait ....