Skip to content

This bundle is an integration of the feskol/php-navigation library with extensions for Symfony applications.

License

Notifications You must be signed in to change notification settings

feskol/NavigationBundle

Repository files navigation

NavigationBundle

Tests codecov

This bundle is an integration of the feskol/php-navigation library with extensions for Symfony applications.

Features

  • Automatically tracks a link's active status and makes it easy to check if a parent navigation item has active child links.
  • Easy to set up and integrate into existing projects.
  • Flexible and extensible for complex navigation structures.

Installation

1. Install the bundle

composer require feskol/navigation-bundle

2. Enable the Bundle

FeskolNavigationBundle should be automatically enabled and configured, thanks to Flex.

If you don't use Flex, you can manually enable it, by adding the following line in your project's config/bundles.php:

<?php

return [
   // ...
   Feskol\Bundle\NavigationBundle\FeskolNavigationBundle::class => ['all' => true],
];

3. Configure the bundle (optional)

There are a few configurations available for this bundle. To make use of it, start by creating a new config file:

# config/packages/feskol_navigation.yaml

feskol_navigation:
    # Change the default template
    #template: 'my-navigation-template.html.twig'

    # Default render active links as normal link-tags instead of span-tag
    #active_as_link: true

Make sure you bin/console cache:clear after you change the config.

Usage

Please read the documentation. It's available in the docs directory of this bundle:

Compatibility

The current version of this bundle has the following requirements:

  • PHP 8.1 or newer is required
  • Symfony 6.1 or newer is required