- What does setono/tag-bag-bundle do?
- It is a Symfony bundle that lets any service collect tags such as scripts, meta tags, and links into tag bags, then render them all at once in Twig templates. It decouples tag generation from your layout so controllers, services, and listeners can add assets without editing templates. The bundle is a thin integration layer over the framework-agnostic setono/tag-bag core library.
- How do I install setono/tag-bag-bundle in a Symfony app?
- Install it with Composer and register the bundle in your Symfony application, which is the expected integration path for a Symfony bundle. Because the bundle is glue over the core tag-bag library, you will also be adopting that library transitively. Check the package constraints and your Symfony bundle registration file before wiring it into production.
- Which PHP and Symfony versions does this bundle support?
- The provided material does not list exact PHP or Symfony version constraints, so verify them in the package's composer.json before adopting it. The evaluation recommends checking the PHP and Symfony constraint matrix against your target runtime and pinning both the bundle and the core tag-bag library. Treat the Twig extension and service definitions as the compatibility-critical surface.
- Does setono/tag-bag-bundle work with Laravel?
- No. It is a Symfony bundle built around Symfony's service container, event subscribers, Twig extension, and configuration tree, so it does not target Laravel. Laravel applications would need a different package or a custom integration. The underlying tag-bag library is framework-agnostic, but this bundle is Symfony-specific.
- How do I add a tag from a controller or service?
- The bundle lets any service collect tags into tag bags, so controllers, services, and event listeners can add scripts, meta tags, links, and similar assets without touching templates. You inject the relevant tag bag service and add tags during the request lifecycle. Rendering happens centrally at output time rather than at the point of collection.
- How do I render collected tags in Twig?
- Rendering is handled by the bundle's Twig extension, which outputs the collected tags at the point you choose in your layout. The overview describes rendering all tags at once in Twig templates. Confirm which rendering entry points the bundle covers, such as head, body, and deferred output, by reading the source.
- Does it support consent or GDPR gating for scripts?
- The provided material does not confirm whether consent and GDPR gating live in this bundle, the core tag-bag library, or must be built by the application. The evaluation explicitly lists this as a key question to resolve before relying on the package for compliance-sensitive tags. Validate conditional rendering against your consent requirements in a spike.
- Can I control tag ordering and deduplication?
- The evaluation says the abstraction enables ordering, deduplication, and conditional rendering in one place, which is a main reason to use it for e-commerce workloads. It also asks how ordering and deduplication behave under concurrent or edge-cached requests, so test those cases. Do not assume behavior without verifying it in the core library and bundle source.
- Is setono/tag-bag-bundle production-ready and well maintained?
- The evaluation flags ecosystem maturity as the dominant risk: five stars and zero dependents means little community validation, and the bus factor is likely one. It also notes a future-dated release timestamp as a data anomaly worth confirming against the repository. MIT licensing removes legal friction but does not de-risk abandonment, so assume you may need to own it.
- Can I override the Twig extension or rendering without forking?
- The evaluation lists this as an open question: whether the rendering layer can be overridden cleanly without forking. Because the bundle is additive and does not own persistence or routing, rollback is trivial if you keep existing template snippets. The recommended approach is to wrap it behind a thin internal TagRenderer-style interface so you are not coupled to Setono's API.