mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 16:43:48 +00:00
allow delegation of block rendering
ref #12 In a template, you can now allow rendering of a block from other bundle. The layout template must explicitly call the rendering of other block, with the twig function ``` chill_delegated_block('block_name', { 'array' : 'with context' } ) ``` This will launch an event `Chill\MainBundle\Templating\Events\DelegatedBlockRenderingEvent` with the event's name 'chill_block.block_name'. You may add content to the page using the function `DelegatedBlockRenderingEvent::addContent`.
This commit is contained in:
@@ -51,6 +51,13 @@ services:
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
||||
chill.main.twig.delegated_block:
|
||||
class: Chill\MainBundle\Templating\DelegatedBlockRenderingTwig
|
||||
arguments:
|
||||
- "@event_dispatcher"
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
||||
chill.main.twig.csv_cell:
|
||||
class: Chill\MainBundle\Templating\CSVCellTwig
|
||||
tags:
|
||||
|
Reference in New Issue
Block a user