Getting started
Twig Hooks are a robust and powerful alternative to the Sonata Block Events and the old Sylius Template Events systems.
Last updated
Was this helpful?
Was this helpful?
sylius_twig_hooks:
hooks:
'my_first_hook':
some_block:
template: 'some_block.html.twig'sylius_twig_hooks:
hooks:
'my_first_hook':
some_block:
template: 'some_block.html.twig'
enabled: true # whether the hookable is enabled
context: [] # key-value pair that will be passed to the context bag
configuration: [] # key-value pair that will be passed to the configuration bag
priority: 0 # priority, the higher the number, the earlier the hookable will be hookedsylius_twig_hooks:
hooks:
'my_first_hook':
some_block:
component: 'app:block' # component key
enabled: true # whether the hookable is enabled
context: [] # key-value pair that will be passed to the context bag
props: [] # key-value pair that will be passed to our component as props
configuration: [] # key-value pair that will be passed to the configuration bag
priority: 0 # priority, the higher the number, the earlier the hookable will be hooked