Using Live Components in Sylius Twig Hooks
Twig Hooks are a robust and powerful alternative to the Sonata Block Events and the old Sylius Template Events system.
Twig Hooks are a robust and powerful alternative to the Sonata Block Events and the old Sylius Template Events system.
A while ago, I covered how you can extend a Sylius Core Twig Component thanks to the Symfony\UX\TwigComponent\Event\PreRenderEvent
event. What about Live Components of Sylius core? Can we extend them as well?
Sylius 2.0 uses Twig Components to create reusable, object-oriented templates. In a recent project, I needed to add information to the sylius_shop.twig.component.product.price
component and was wondering how to achieve this best.
Can we render the XML responses from a webservice our application interacts in a better readable way? This was the challenge I asked myself.
Think of Sylius Template Events as a kind of hook in your Twig template that you can extend without modifying the original twig template.