Installation
Add the bundle to your composer.json:
composer require 7rin0/bigfoot-core-bundle
Register it in config/bundles.php:
return [
// ...
SevenRin0\BigfootCoreBundle\SevenRin0BigfootCoreBundle::class => ['all' => true],
];
First Use Case
The bundle provides a Bigfoot service for core functionality. Inject it into a controller/service:
use SevenRin0\BigfootCoreBundle\Service\Bigfoot;
class MyController extends AbstractController {
public function index(Bigfoot $bigfoot) {
// Example: Fetch default theme config
$themeConfig = $bigfoot->getThemeConfig();
return $this->json($themeConfig);
}
}
Where to Look First
SevenRin0\BigfootCoreBundle\DependencyInjection\SevenRin0BigfootCoreExtension for configurable options.Service/Bigfoot.php class for available methods (e.g., getThemeConfig(), getAssetPath()).config/packages/7rin0_bigfoot_core.yaml (if the bundle supports it).Theme Management
Use the Bigfoot service to dynamically fetch theme assets or configurations:
$themeName = $bigfoot->getActiveTheme();
$assetsUrl = $bigfoot->getAssetPath('themes/' . $themeName);
Asset Handling The bundle likely provides helper methods for theme-specific assets (CSS/JS):
$cssUrl = $bigfoot->getThemeAssetUrl('styles/main.css');
$this->addCss($cssUrl); // Twig/Framework integration
Configuration Overrides Extend or override theme/config behavior via Symfony’s dependency injection:
# config/packages/7rin0_bigfoot_core.yaml
seven_rin0_bigfoot_core:
themes:
default: 'custom_theme'
assets_path: '%kernel.project_dir%/var/assets'
Event Listeners Hook into theme changes or asset events (if the bundle emits events):
// src/EventListener/ThemeListener.php
class ThemeListener implements EventSubscriberInterface {
public static function getSubscribedEvents() {
return [
BigfootEvents::THEME_CHANGED => 'onThemeChanged',
];
}
public function onThemeChanged(ThemeEvent $event) {
// Custom logic (e.g., cache invalidation)
}
}
Twig Integration
Pass the Bigfoot service to Twig templates:
{% set themeConfig = bigfoot.getThemeConfig() %}
<link rel="stylesheet" href="{{ bigfoot.getThemeAssetUrl('styles/main.css') }}">
Bigfoot service in unit tests to isolate logic:
$this->mockBuilder()
->disableOriginalConstructor()
->getMock()
->method('getThemeConfig')
->willReturn(['key' => 'value']);
Symfony 3 Only The bundle is Symfony 3.x-specific. Avoid using it in Symfony 4/5/6 without compatibility checks or forks.
Undocumented Methods
The bundle has no visible documentation or PHPDoc. Use reflect to inspect methods:
$reflection = new ReflectionClass(Bigfoot::class);
$methods = $reflection->getMethods();
Asset Path Assumptions
Hardcoded paths (e.g., Resources/public) may break if your project structure differs. Override via config:
seven_rin0_bigfoot_core:
assets_path: '%kernel.project_dir%/custom_assets'
No Event Dispatcher If the bundle lacks events, you may need to wrap its methods to emit custom events:
$theme = $bigfoot->getActiveTheme();
$this->eventDispatcher->dispatch(new ThemeChangedEvent($theme));
Theme Loading Order
If themes are loaded dynamically, ensure your config/packages/7rin0_bigfoot_core.yaml defines a fallback:
seven_rin0_bigfoot_core:
themes:
default: 'fallback_theme'
Bigfoot service to inspect available methods:
dump(service('seven_rin0_bigfoot_core.bigfoot'));
# config/packages/dev/monolog.yaml
monolog:
handlers:
bigfoot:
type: stream
path: "%kernel.logs_dir%/bigfoot.log"
level: debug
_profiler) to verify theme asset paths.Custom Themes
Extend the bundle by creating a new theme bundle or overriding the Bigfoot service:
# config/services.yaml
services:
SevenRin0\BigfootCoreBundle\Service\Bigfoot:
class: App\Service\CustomBigfoot
arguments: ['@seven_rin0_bigfoot_core.bigfoot']
Asset Compiler
If the bundle lacks asset compilation, integrate with Symfony’s AssetMapper or WebpackEncore:
$assetUrl = $this->assetMapper->getUrl($bigfoot->getAssetPath('themes/default/css/main.css'));
Database-Backed Themes
Store theme configurations in a database and override the Bigfoot service to fetch them dynamically:
class DatabaseBigfoot extends Bigfoot {
public function getThemeConfig() {
return $this->dbThemeRepository->findActiveTheme();
}
}
Translation Support Add translation keys for theme labels/configs:
# config/packages/7rin0_bigfoot_core.yaml
seven_rin0_bigfoot_core:
themes:
labels:
default: 'app.theme.default_label'
How can I help you explore Laravel packages today?