appventus/bootstrap-almanach-bundle
Installation Add the package via Composer:
composer require appventus/bootstrap-almanach-bundle
Register the bundle in config/bundles.php (Symfony 4+):
AppVentus\BootstrapAlmanachBundle\BootstrapAlmanachBundle::class => ['all' => true],
First Use Case
Locate the Twig templates in vendor/appventus/bootstrap-almanach-bundle/resources/views/. Extend a base template (e.g., base.html.twig) to include Bootstrap components:
{% extends 'bootstrap-almanach::base.html.twig' %}
Use a component (e.g., a button) in your template:
{% include 'bootstrap-almanach::button.html.twig' with {'label': 'Click Me'} %}
Key Directories
resources/views/ – Pre-built Twig components.Resources/public/ – Static assets (CSS/JS, if included).Component Reusability
base.html.twig to inherit Bootstrap’s global styles (e.g., grid, utilities).alert.html.twig) in your project’s templates/bootstrap-almanach/ directory.Dynamic Component Usage Pass variables to components for flexibility:
{% include 'bootstrap-almanach::card.html.twig' with {
'title': 'User Profile',
'body': 'Content here',
'classes': 'mb-4'
} %}
Asset Management
asset() or url() functions if the bundle doesn’t auto-register them.vendor/ to public/.Symfony Form Integration Use the bundle’s form themes (if provided) to style Symfony forms with Bootstrap classes:
{% form_theme form 'bootstrap-almanach::form_theme.html.twig' %}
Layout Patterns
bootstrap-almanach::container.html.twig for responsive layouts.row.html.twig inside a container.html.twig).Archived Status
Missing Documentation
resources/views/ or tests/ directories.{{ block('...') }} in templates to identify extendable blocks.Asset Conflicts
base.html.twig:
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
Twig Namespace Quirks
bootstrap-almanach::) to avoid conflicts with custom templates named similarly.Template Overrides
templates/bootstrap-almanach/ to override defaults. Twig will prioritize these.Variable Dumping Debug component inputs with:
{% dump component_vars %}
Bootstrap Version Mismatch
composer.json of the bundle).Custom Components
templates/bootstrap-almanach/ and include them like built-in components.Configuration
{% set %} or Symfony’s twig.config to customize globally:
{% set bootstrap_version = '5.3.0' %}
JavaScript Integration
base.html.twig or via Webpack Encore.How can I help you explore Laravel packages today?