Skip to content

Conversation

@tomkalon
Copy link

Allows you to add the type parameter to TwigHook:

  • useful when changing the hook type from template to component and vice versa.
sylius_twig_hooks:
    hooks:
        'sylius_shop.product.show.content.info.overview.images':
            main_image:
                component: 'sylius_shop:product:images'
                props:
                    product: '@=_context.product'
                    template: '@SyliusShop/product/show/content/info/overview/images/main_image.html.twig'
                priority: 0

Can be overwritten by:

sylius_twig_hooks:
    hooks:
        'sylius_shop.product.show.content.info.overview.images':
            main_image:
                template: 'shop/product/show/content/info/overview/images/main_image.html.twig'
                type: 'template'

@tomkalon tomkalon force-pushed the feature/twig-hook-type-parameter branch from d25e71e to 3b320d2 Compare November 28, 2025 15:18

final class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder(): TreeBuilder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
* @return TreeBuilder<'array'>
*/
public function getConfigTreeBuilder(): TreeBuilder

Here you have more inspiration: https://github.com/Sylius/SyliusGridBundle/blob/1.15/src/Bundle/DependencyInjection/Configuration.php#L25

@tomkalon tomkalon force-pushed the feature/twig-hook-type-parameter branch 3 times, most recently from 9079935 to 6148f7f Compare November 28, 2025 15:29
@tomkalon tomkalon force-pushed the feature/twig-hook-type-parameter branch from 6148f7f to f870fa2 Compare November 28, 2025 15:36
@tomkalon tomkalon force-pushed the feature/twig-hook-type-parameter branch 5 times, most recently from eb793a2 to 4bbdf3b Compare December 1, 2025 09:24
…lify ignore rules for NodeBuilder-related false positives."
@tomkalon tomkalon force-pushed the feature/twig-hook-type-parameter branch from 4bbdf3b to f08fd6a Compare December 1, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants