Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Bigfoot Core Bundle Laravel Package

7rin0/bigfoot-core-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. 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],
    ];
    
  2. 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);
        }
    }
    
  3. Where to Look First

    • Service Container: Check SevenRin0\BigfootCoreBundle\DependencyInjection\SevenRin0BigfootCoreExtension for configurable options.
    • Documentation: Review the Service/Bigfoot.php class for available methods (e.g., getThemeConfig(), getAssetPath()).
    • Configuration: Override defaults in config/packages/7rin0_bigfoot_core.yaml (if the bundle supports it).

Implementation Patterns

Common Workflows

  1. Theme Management Use the Bigfoot service to dynamically fetch theme assets or configurations:

    $themeName = $bigfoot->getActiveTheme();
    $assetsUrl = $bigfoot->getAssetPath('themes/' . $themeName);
    
  2. 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
    
  3. 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'
    
  4. 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)
        }
    }
    
  5. Twig Integration Pass the Bigfoot service to Twig templates:

    {% set themeConfig = bigfoot.getThemeConfig() %}
    <link rel="stylesheet" href="{{ bigfoot.getThemeAssetUrl('styles/main.css') }}">
    

Integration Tips

  • Asset Pipeline: Use the bundle’s asset helpers to generate URLs for theme files (avoid hardcoding paths).
  • Caching: Cache theme configurations or asset paths if the bundle supports dynamic themes.
  • Testing: Mock the Bigfoot service in unit tests to isolate logic:
    $this->mockBuilder()
         ->disableOriginalConstructor()
         ->getMock()
         ->method('getThemeConfig')
         ->willReturn(['key' => 'value']);
    

Gotchas and Tips

Pitfalls

  1. Symfony 3 Only The bundle is Symfony 3.x-specific. Avoid using it in Symfony 4/5/6 without compatibility checks or forks.

  2. Undocumented Methods The bundle has no visible documentation or PHPDoc. Use reflect to inspect methods:

    $reflection = new ReflectionClass(Bigfoot::class);
    $methods = $reflection->getMethods();
    
  3. 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'
    
  4. 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));
    
  5. 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'
    

Debugging Tips

  • Service Dumping: Dump the Bigfoot service to inspect available methods:
    dump(service('seven_rin0_bigfoot_core.bigfoot'));
    
  • Log Configuration: Enable debug mode to log bundle behavior:
    # config/packages/dev/monolog.yaml
    monolog:
        handlers:
            bigfoot:
                type: stream
                path: "%kernel.logs_dir%/bigfoot.log"
                level: debug
    
  • Asset Debugging: Use Symfony’s asset debugger (_profiler) to verify theme asset paths.

Extension Points

  1. 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']
    
  2. 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'));
    
  3. 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();
        }
    }
    
  4. 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'
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views