Installation Add the bundle via Composer (if still functional):
composer require c2is/bigfoot-navigation-bundle
Register the bundle in AppKernel.php (Symfony 2.x) or config/bundles.php (Symfony 3.x+):
// AppKernel.php
new C2is\BigfootNavigationBundle\BigfootNavigationBundle(),
Configuration
Locate config.yml or bigfoot_navigation.yml in config/packages/ (or app/config/ for older versions). Define your navigation structure:
bigfoot_navigation:
menu:
items:
- label: 'Home'
uri: '/'
- label: 'About'
uri: '/about'
First Use Case Render the navigation in a Twig template:
{{ render(navigation.menu) }}
Or fetch it programmatically:
$menu = $this->get('bigfoot.navigation.manager')->getMenu();
Dynamic Menu Building Use Twig extensions or PHP services to conditionally load menu items:
{% if app.user %}
{{ render(navigation.menu, {'user': app.user}) }}
{% endif %}
Nested Menus Define hierarchical menus in YAML:
items:
- label: 'Products'
uri: '#'
children:
- label: 'Product 1'
uri: '/product/1'
Integration with Security Combine with Symfony’s security component to hide/show items:
items:
- label: 'Admin'
uri: '/admin'
roles: [ROLE_ADMIN]
Event-Driven Extensions
Listen to bigfoot.navigation.build events to modify menus dynamically:
// src/EventListener/NavigationListener.php
public function onBuildMenu(BuildMenuEvent $event) {
$event->addItem(new MenuItem('Custom Item', '/custom'));
}
bigfoot_navigation_dev.yml).bigfoot_navigation:
cache: true
Deprecated Symfony Version The package was last updated in 2014 and may not support Symfony 4.5+ or PHP 7.4+. Test thoroughly or fork the repo.
YAML Parsing Quirks
label: 'O’Reilly').Twig Rendering Issues
If {{ render(navigation.menu) }} fails, ensure:
services.yaml).Event System Limitations
The BuildMenuEvent may not be fully documented. Inspect the source (src/Event/BuildMenuEvent.php) for available methods.
dump($this->get('bigfoot.navigation.manager')->getMenu());
php bin/console cache:clear
Custom Menu Builders
Override the default builder by implementing C2is\BigfootNavigationBundle\Builder\MenuBuilderInterface.
Database-Backed Menus Extend the bundle to fetch menus from a database (e.g., via a custom loader service).
Frontend Frameworks Output menus as JSON for React/Vue:
{{ navigation.menu|json_encode|raw }}
How can I help you explore Laravel packages today?