Weave 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

Theme Elaostrap Bundle Laravel Package

elao/theme-elaostrap-bundle

Symfony bundle providing the ElaoStrap theme for Elao Theme Bundle, including ready-to-use form themes and Twig helpers. Install via Composer and enable the bundle to apply ElaoStrap styling in your app.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the bundle to your Laravel project via Composer (if using Symfony/Laravel bridge):

    composer require elao/theme-elaostrap-bundle
    

    Register the bundle in config/bundles.php (Symfony) or AppServiceProvider (Laravel):

    // For Symfony
    Elao\Theme\ElaoStrapBundle\ElaoThemeElaoStrapBundle::class => ['all' => true],
    
  2. Enable the Theme Configure config/packages/elao_theme.yaml (Symfony) or config/elao_theme.php (Laravel):

    theme: elao_strap
    
  3. First Use Case Extend a base template (e.g., base.html.twig) in templates/elao_strap/:

    {% extends 'elao_strap/base.html.twig' %}
    {% block body %}
        <h1>Hello, ElaoStrap!</h1>
    {% endblock %}
    

Implementation Patterns

Twig Integration

  • Template Overrides Override default Twig templates in templates/elao_strap/ (e.g., layout.html.twig, navbar.html.twig). Example:

    {% block navbar %}
        {{ parent() }} <!-- Extend parent block -->
        <div class="custom-nav-item">My App</div>
    {% endblock %}
    
  • Dynamic Assets Use Twig functions to load assets (CSS/JS) dynamically:

    {{ asset('bundles/elaostrap/css/main.css') }}
    

Symfony/Laravel Bridge

  • Service Injection Bind Symfony services to Laravel via AppServiceProvider:

    public function register()
    {
        $this->app->singleton('elao.theme', function ($app) {
            return $app->make('elao_theme');
        });
    }
    
  • Event Listeners Subscribe to elao_theme.events (Symfony) or elao.theme (Laravel) for theme lifecycle hooks:

    // Symfony Event Listener
    public function onThemeInit(ThemeInitEvent $event) {
        $event->setOption('custom_var', 'value');
    }
    

Asset Management

  • Webpack Encore Configure webpack.config.js to process ElaoStrap assets:
    Encore
        .addEntry('elaostrap', './vendor/elao/theme-elaostrap-bundle/resources/assets/js/main.js')
        .enableSassLoader()
    

Gotchas and Tips

Debugging

  • Template Caching Clear Twig cache after overrides:

    php bin/console cache:clear --env=prod
    

    Laravel: php artisan view:clear.

  • Asset Paths Verify public_path() (Laravel) or %kernel.project_dir% (Symfony) in asset URLs to avoid 404s.

Configuration Quirks

  • Theme Fallback If elao_strap fails, ensure a fallback theme is set in elao_theme.yaml:

    fallback_theme: bootstrap_4
    
  • Deprecated Features Check ElaoThemeElaoStrapBundle for deprecated methods (e.g., getThemeConfig() → getOptions()).

Extension Points

  • Custom Components Extend Twig with custom filters/filters:

    {% filter custom_filter %}
        {{ variable }}
    {% endfilter %}
    

    Register in services.yaml (Symfony) or AppServiceProvider (Laravel).

  • CSS/JS Overrides Use !important sparingly; prefer BEM methodology for scoped styles:

    .elao-strap-component {
        &__element { ... }
    }
    
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.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log