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

Foundationbundle Laravel Package

arachnias/foundationbundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the package via Composer:

    composer require arachnias/foundationbundle
    

    Register the bundle in config/bundles.php (Symfony) or config/app.php (Laravel via Symfony bridge):

    Arachnias\FoundationBundle\ArachniasFoundationBundle::class => ['all' => true],
    
  2. First Use Case Use the Twig helpers in a template. Example:

    {% foundation_grid %}
        {% foundation_column 6 %}
            <h1>Hello Foundation!</h1>
        {% endfoundation_column %}
    {% endfoundation_grid %}
    
  3. Where to Look First

    • Twig Helpers: Check src/Resources/views/ for available Twig extensions.
    • Documentation: Review README.md for basic usage examples.
    • Foundation Docs: Refer to Zurb Foundation for CSS/JS patterns.

Implementation Patterns

Common Workflows

  1. Responsive Grids Use foundation_grid and foundation_column for responsive layouts:

    {% foundation_grid %}
        {% foundation_column 4 %}
            <div>Column 1</div>
        {% endfoundation_column %}
        {% foundation_column 8 %}
            <div>Column 2</div>
        {% endfoundation_column %}
    {% endfoundation_grid %}
    
  2. Buttons and Forms Leverage helpers like foundation_button or foundation_form:

    {% foundation_button type="primary" %}
        Submit
    {% endfoundation_button %}
    
  3. Modals and Tooltips Use foundation_modal or foundation_tooltip for interactive elements:

    {% foundation_tooltip text="Help text" %}
        <span>Hover me</span>
    {% endfoundation_tooltip %}
    
  4. Integration with Laravel

    • Blade to Twig: Use Blade::render() or TwigBridge to mix Blade and Twig.
    • Service Providers: Bind Twig extensions in AppServiceProvider:
      public function boot()
      {
          $twig = $this->app['twig'];
          $twig->addExtension(new \Arachnias\FoundationBundle\Twig\FoundationExtension());
      }
      
  5. Customizing Foundation Override default templates by extending Twig paths or creating custom blocks.


Gotchas and Tips

Pitfalls

  1. Twig Extension Conflicts

    • Ensure no duplicate Twig extensions are registered.
    • Clear cache after adding the bundle:
      php artisan cache:clear
      
  2. Foundation Version Mismatch The bundle uses zurb/foundation:dev-master. Pin a stable version in composer.json to avoid breaking changes:

    "require": {
        "zurb/foundation": "6.*"
    }
    
  3. CSS/JS Not Loading

    • Verify Foundation assets are published:
      php artisan vendor:publish --provider="Arachnias\FoundationBundle\FoundationBundle"
      
    • Check app.blade.php or base.html.twig for included scripts.
  4. Twig Syntax Errors

    • Use {% raw %} for dynamic content to avoid Twig parsing issues:
      {% raw var %}
      

Debugging Tips

  • Check Twig Errors: Enable Twig debug mode in config/twig.php:
    'debug' => env('APP_DEBUG', true),
    
  • Inspect Helpers: Use {{ dump(_context) }} to debug available Twig variables.

Extension Points

  1. Custom Twig Helpers Extend the bundle by creating a custom Twig extension:

    class CustomFoundationExtension extends \Twig_Extension
    {
        public function getFunctions()
        {
            return [
                new \Twig_SimpleFunction('custom_helper', [$this, 'customHelper']),
            ];
        }
    }
    
  2. Override Templates Copy templates from vendor/arachnias/foundationbundle/Resources/views/ to resources/views/vendor/foundation/ to customize.

  3. Foundation Sass Integration Import Foundation Sass variables in resources/sass/app.scss:

    @import "~foundation-sites/scss/foundation";
    
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.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours