Download the PHP package doppy/nav-bundle without Composer

On this page you can find all versions of the php package doppy/nav-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 nav-bundle

Doppy Nav Bundle

A Symfony bundle providing some useful tools to create menu's and make them cacheable.

installation

add to composer

` And make sure the bundle is registered. At the moment there is no recipe for symfony flex, but the default recipe should suffice in most situations.

Create your own NavBuilder

You can create your own NavBuilder service. This service will return a Nav object containing NavItem's, which is effectively your navigation or menu.

Configure your service in symfony, adding a simple tag to make it available:

`

The parameter provides is mandatory and is the name under which your Nav will be available.

You can add your own depenencies when needed. Useful suggestions could be tokenstorage and authorization_checker, if you want to customize your Nav for a specific user or based on permissions.

You can decide yourself what you want to do with translations of nav-labels. You can set the correct text in the Builder itself, or run the label through the translator when rendering the template.

Both the Nav and NavItem objects have a property attributes available, which you can use freely to configure additional properties you might need when rendering.

Use your Nav

There are several ways to use the Nav you created:

Retrieve it from the Provider

You can just request the Nav object from the provider. This way you could insert one Nav into another.

`

Retrieve it in Twig

By retrieving the object in Twig, you can then use this to render it in any way you like.

`

This is the same as the get method on the Provider (see above).

Render it in Twig

You can also directly render the Nav in twig. This is a more clean solution, and also supports caching.

`

Cache your Nav's

Because chances are it doesn't change that often, it might be a good idea to cache your Nav.

Configure Caching

Make sure the symfony/cache component is installed (via composer), as this is used for caching. Adjust your config to enable caching:

`

You need to specify the name of the cache service to use.

Which cache you use is up to you, but you might not need both. In most simple cases you would only need to enable render.

Cache is disabled by default.

To adjust the cache duration, adjust the configuration of the supplied service.

Cacheable Builder

To make your Builder cacheable, simply implement the interface Doppy\NavBundle\Builder\CacheableBuilderInterface. You now need to provide an additional method that supplies the cache-key to use when the Nav is requested. Usually the basic name will suffice, but if you customize your Nav for a specific user, you would want to add the username or userid.

A suffix will be appended to your cachekey, this is constructed from:

Invalidation

At the moment there is no cache invalidation configured. You just need to wait until it expires, or clear all symfony caches.

Advanced: Create your own provider

A builder can only create 1 nav (but you can tweak this a bit with options). You can add your own Provider that is capable of managing a large set of Nav's. You need to implement the interface \Doppy\NavBundle\Provider\ProviderInterface. This can be useful if wou want to manage them in a database for instance.

To see how to do this, take a look at the service doppy_nav.provider.builder.

You can also use \Doppy\NavBundle\Provider\CacheableProviderInterface to make your provider cacheable.


All versions of nav-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
symfony/framework-bundle Version ^4.0
twig/twig Version ^2.4
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 doppy/nav-bundle contains the following files

Loading the files please wait ....