Navigation management for symfony
This bundle provide Bootstrap Navigation bar configure in config files
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Open a command console, enter your project directory and execute:
composer require ics/navigation-bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require ics/navigation-bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
// config/bundles.php
return [
// ...
ICS\NavigationBundle\NavigationBundle::class => ['all' => true],
];
# config/packages/navigation.yaml
navigation:
navbars:
mainnav:
brand: BrandText
brandIcon: fa fa-check
color: dark
fixed: sticky
searchenabled: true
searchroute: homepage
items:
homepage:
lib: homepage
icon: fa fa-home
route: homepage
usermenu:
activate: true
connexionroute: homepage
autolib: false
childs:
logout:
lib: Sign-out
icon: fa fa-sign-out
route: homepage
And Add renderer in your base.html.twig
{# templates/base.html.twig #}
<body>
{{ renderNavBar('mainnav') }}
this is the full configuration with default value
navigation:
usermenu:
activate: false
autolib: true
lib: User Menu
connexionlib: Sign In
connexionicon : fa fa-sign-in-alt
connexionroute: app-login
childs:
item1:
lib: ''
icon: ''
route: ''
roles: []
navbars:
navbar1: ''
brand: ''
brandRoute: homepage
brandIcon: ''
brandImage: ''
type: navbar # navbar or sidebar
searchenabled: false
searchroute: search
color: light # primary, secondary, success, danger, warning, info, light, dark, white, transparent
fixed: none # none, top, bottom, sticky
items:
items1:
lib: ''
icon: ''
route: ''
roles: []
childs:
child1:
lib: ''
icon: ''
route: ''
roles: []
This software is published under the MIT License